Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4406

msal issue with blazor wasm in authenticationStateProvider

$
0
0

Does anybody faced the issue where you can run msal authentication with azure AD b2c in blazor wasm but as popup only? how can you get it to work to login using a form that has email and password and pass it directly? For example i have something like this

var tokenResult = await _tokenProvider.RequestAccessToken(new AccessTokenRequestOptions{    Scopes = _scope});if (tokenResult.TryGetToken(out var token)){    return token.Value;}else{    // Fall back to interactive redirect.    var options = new InteractiveRequestOptions    {        Interaction = InteractionType.SignIn,        ReturnUrl = _navigationManager.BaseUri    };    _navigationManager.NavigateToLogin("authentication/login", options);    throw new Exception("Token acquisition failed. Redirecting to login.");}

I also tried to create a webapi that uses microsoft graph so i can login using that and get back the access token but if i override AuthenticationStateProvider in WASM, msal does not work. i can use either of them so anybody has a solution for it? also my login using email method gets the token but i cannot update authenticationAppState


Viewing all articles
Browse latest Browse all 4406

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>