AAD B2C: Get New Access Token using Microsoft.AspNetCore.Authentication.OpenIdConnect
I'm using Microsoft.AspNetCore.Authentication.OpenIdConnect in my code to get ID Token, Code and Token. For OpenIdConnectOptions, I have set ResponseType to "code id_token token"
and the scope to "openid, profile, and offline_access"
I use a custom policy to login with MFA support to AAD B2C. Upon successful login, I receive ID Token, Code and Access Token. I don't receive a refresh token. I store away the ID Token, Code, and Access Token in OnTokenValidated event. I use the stored Access Token to access resources. When the Access Token expires, what method do I use to get a new Access Token?
I'm able to obtain the Refresh Token when I call HttpContext.GetTokenAsync("refresh_token").Result on my Razor page.
I use Microsoft.Identity.Web.UI to handle sign in and sign out.
I have tried to call HttpContext.SignInAsync() or HttpContext.AuthnticateAsync(). I still the same old Access Token.