IdentityServer / IdentityServer4

OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
https://identityserver.io
Apache License 2.0
9.23k stars 4.02k forks source link

Issues with IdentityServer4 w/ web api using IdentityServer3.AccessToken #903

Closed Ya-Wang closed 7 years ago

Ya-Wang commented 7 years ago

http://stackoverflow.com/questions/42724680/identityserver4-with-identityserver3-accesstokenvalidation

All documentation in above link. Will move here if needed.

Ya-Wang commented 7 years ago

Exception thrown: 'System.Reflection.ReflectionTypeLoadException' in mscorlib.dll iisexpress.exe Warning: 0 : Message='Exception thrown while getting types from 'Microsoft.IdentityModel.Protocol.Extensions, Version=1.0.40306.1554, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.', Exception=System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at System.Web.Http.Tracing.Tracers.DefaultHttpControllerTypeResolverTracer.GetTypesAndTrace(Assembly assembly)

Possible reason?

leastprivilege commented 7 years ago

try updating to latest nugets.

If that doesn't help - try manually updating System.Net.Http to 4.3.1

Ya-Wang commented 7 years ago

Below are my packages. (packages.config) for the .net framework web API I intend on connecting to authenticate with IdentityServer4

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="IdentityModel" version="1.13.1" targetFramework="net452" />
  <package id="IdentityServer3.AccessTokenValidation" version="2.14.0" targetFramework="net452" />
  <package id="Microsoft.AspNet.Cors" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.Tracing" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" />
  <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.3" targetFramework="net452" />
  <package id="Microsoft.IdentityModel.Logging" version="1.1.3" targetFramework="net452" />
  <package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.4.403061554" targetFramework="net452" />
  <package id="Microsoft.IdentityModel.Tokens" version="5.1.3" targetFramework="net452" />
  <package id="Microsoft.Net.Compilers" version="2.0.1" targetFramework="net452" developmentDependency="true" />
  <package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
  <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net452" />
  <package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net452" />
  <package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net452" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
  <package id="Owin" version="1.0" targetFramework="net452" />
  <package id="System.IdentityModel.Tokens.Jwt" version="5.1.3" targetFramework="net452" />
  <package id="System.Net.Http" version="4.3.1" targetFramework="net452" />
</packages>
leastprivilege commented 7 years ago

so what?

Ya-Wang commented 7 years ago

Opps sorry. I mean so you can take a look to see if there are any conflicting packages or and discrepancies that would raise concerns.

Also can you please point me to the specific project in the CrossIntegration testing I can refer to for API(identityserver3AccessToken) authenticating with Identityserver4 core ?

Thanks for your help so far!

leastprivilege commented 7 years ago

https://github.com/IdentityServer/CrossVersionIntegrationTests

Ya-Wang commented 7 years ago

I see projects for Core api to Idnserver3

I don't see Not Core Api to Idnserver4.

leastprivilege commented 7 years ago

Any update on the issue? closing for now - feel free to re-open if it needs further discussion.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.