IdentityServer / IdentityServer3.AspNetIdentity

ASP.NET Identity support for Thinktecture IdentityServer3
Apache License 2.0
64 stars 51 forks source link

IdentityServer3.AspNetIdentity tries to load nonexistant IdentityModel.Net45.dll #75

Open vidarkongsli opened 8 years ago

vidarkongsli commented 8 years ago

I am setting up IdSrv3 (2.5.4) with IdentityServer3.AspNetIdentity (2.0.0) and IdentityModel (2.0.0 / 1.13.0). I get this exception in the event log when trying to do a UserService operation:

System.IO.FileNotFoundException: Could not load file or assembly 'IdentityModel.Net45, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'IdentityModel.Net45, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at IdentityServer3.AspNetIdentity.AspNetIdentityUserService2.d__29.MoveNext()

Is the newer versions of IdentityModel not compatible?

vidarkongsli commented 8 years ago

I downgraded IdentityModel to 1.3.1 and it now works. IdentityModel 1.4.0 and newer breaks.

leastprivilege commented 8 years ago

2.0 is a breaking change (by design).

vidarkongsli commented 8 years ago

Do you mean IdentityModel 2.0 is a breaking change? Or IdentityServer3.AspNetIdentity 2.0?

leastprivilege commented 8 years ago

IdentityModel - it's using semantic versioning - so yes from 1 to 2 there are breaking changes.

vidarkongsli commented 8 years ago

Right. However, IdentityModel versions between 1.4 and 1.13 seems to break IdentityServer3.AspNetIdentity. Nuget package dependency states that i IdentityServer3.AspNetIdentity depends on IdentityModel version >= 1.0.0, meaning that 1.4 thru 1.13 should work.

patroza commented 7 years ago

I also ran into this. I switched back and forth between 2.0 and 1.13 a couple of times, im not sure whats up now. I'm on 1.13 but get this issue still, with no reference anywhere to this .Net45 dll.

2016-11-02 22:55:29,650 ERROR IdentityServer3.Core.Configuration.Hosting.ErrorPageFilterAttribute [1d363e3c-aec7-4df0-8d92-287c04c75b01] [(null)]: Exception accessing: /identity/callbackSystem.IO.FileNotFoundException: Could not load file or assembly 'IdentityModel.Net45, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'IdentityModel.Net45, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at IdentityServer3.AspNetIdentity.AspNetIdentityUserService`2.<UpdateAccountFromExternalClaimsAsync>d__29.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at IdentityServer3.AspNetIdentity.AspNetIdentityUserService`2.UpdateAccountFromExternalClaimsAsync(TKey userID, String provider, String providerId, IEnumerable`1 claims)
   at IdentityServer3.AspNetIdentity.AspNetIdentityUserService`2.<AccountCreatedFromExternalProviderAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer3.AspNetIdentity.AspNetIdentityUserService`2.<ProcessNewExternalAccountAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IdentityServer3.AspNetIdentity.AspNetIdentityUserService`2.<AuthenticateExternalAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at IdentityServer3.Core.Endpoints.AuthenticationController.<LoginExternalCallback>d__1e.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.System.Web.Http910180.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
patroza commented 7 years ago

Not sure why a dll's name changed (breaking change), in a minor update (1.13), but it would require IdentityServer3.AspNetIdentity to be updated: https://github.com/IdentityServer/IdentityServer3.AspNetIdentity/issues/76