-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4312b08
commit 02c1343
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# identitymodelbindingissue | ||
|
||
This application demonstrates the issue reported at: https://github.com/IdentityModel/IdentityModel2/issues/154 | ||
|
||
## Issue details | ||
|
||
Using IdentityServer4.AccessTokenValidation works perfectly fine with IdentityModel Version 3.9.0 but after upgrading to IdentityModel 3.10.1 the | ||
call to `AddIdentityServerAuthentication` in `Startup.cs` causes the following exception: | ||
|
||
``` | ||
Could not load file or assembly 'IdentityModel, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040). | ||
``` | ||
|
||
* ASP.NET Core Web Application targeting .NET Framework 4.7.2 causes an exception due to a missing bindingredirect | ||
* AutoGenerateBindingRedirects is set to `true` and binding redirects are being created (after building the solution there is a `IdentityModelBindingIssue.exe.config` file in the `bin\debug\net472` folder | ||
that contains a lot of binding redirects) | ||
* IdentityServer4.AccessTokenValidation package depends on IdentityModel.AspNetCore.OAuth2Introspection which depends on IdentityModel 3.8.0 | ||
* No binding redirect gets created for the transient dependency IdentityModel 3.8.0 (see commit 15f80e0e4a72b5653e6821372cb14f0081a49b5e) | ||
|
||
## Attempts to fix | ||
|
||
### Attempt 1 | ||
|
||
* called `sn -T identitymodel.dll` to get the public key token: `e7877f4675df049f` | ||
* manually added a web.config file and specified a binding redirect for IdentityModel (see latest commit) | ||
|
||
#### Result | ||
|
||
* BindingRedirect from web config gets merged into automatically generated binding redirects in `IdentityModelBindingIssue.exe.config` but the problem remains | ||
|
||
### Attempt 2 | ||
|
||
* disabled automatic binding redirects | ||
|
||
#### Results 1 | ||
|
||
* started program, some other assembly-load-exceptions occured (as expected) | ||
* added a web.config and put all bindingredirects in there - they were ignored | ||
|
||
#### Results 2 | ||
|
||
* removed web.config and added an app.config with bindingredirects | ||
* app started up to the call to `AddIdentityServerAuthentication` and then the addembly load exception for the IdentityModel.dll reappeared | ||
|
||
|