Closed cedrox closed 4 years ago
The web API server (todolistservice in "Web API now calls Microsoft Graph") has this exception and return 401 status to the client WPF application.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET https://localhost:44351/api/todolist
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
Failed to validate the token.
System.MissingMethodException: Method not found: 'Microsoft.IdentityModel.Tokens.SecurityKey Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.FindKeyMatch(System.String, System.String, Microsoft.IdentityModel.Tokens.SecurityKey, System.Collections.Generic.IEnumerable`1
@CitronBaBa @cedrox what version of Microsoft.IdentityModel.JsonWebTokens is being uses? What version was used before?
@brentschmaltz : I think that ASP.NET Core uses Wilson 5 whereas Microsoft.Identity.Web uses Wilson 6.x (with the increment that Maria and I did) I guess the fix is to update all the Web APIs to Wilson 6.x? cc: @TiagoBrenck
Yes, we had a teams meeting where updating to 6.5.0 explicitly would fix the issue.
I confirm that the fix is working. Thank you very much for responding so quickly!
@cedrox super to hear. Thanks for contacting us.
Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Window 10
Versions
Mention any other details that might be useful
On a demo tenant where I am admin, I have follow all the manual step after running the configure.ps1 script. Details here :
IMPORTANT: Please follow the instructions below to complete a few manual step(s) in the Azure portal :
[Optional] If you are a tenant admin, you can navigate to the API Permisions page and select 'Grant admin consent for (your tenant)'
And
In the list of pages for the application registration of the TodoListService-v2 application, select Manifest
in the manifest, search for "accessTokenAcceptedVersion", and replace null by 2. This property lets Azure AD know that the Web API accepts Microsoft identity platform (v2.0) tokens Select Save
Thanks to confirm