I´m following the Quickstarts from IdentityServer4. When I implement the "Switching to Hybrid Flow and adding API Access back" tutorial, I found that the method to get the access token in line:
ViewContext.HttpContext.Authentication.GetTokenAsync("access_token")
is not available. Someone knows what method I must to use? Thanks.
The problem was that in my MVC controller I had the using Microsoft.AspNetCore.Authorization;. This library allows use the [Authorize] attribute but has his own HttpContext.Authentication namespace. The solution is add using Microsoft.AspNetCore.Authentication and now I can access to the GetTokenAsync method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With