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

How to configure login redirect uri in Blazor WASM?

$
0
0

When I clicked the login button in development environment, the browser always redirected to production URL (I wanted the development URL). I had two redirect URI in Azure AD. How to configure the redirect URL? I had checked the official documents offered by Microsoft, but I can't find the answer.

Redirect URI (I put them to Azure AD B2C):

I created blazor wasm project with auth function. I had the following config in appsettings.json:

{"AzureAdB2C": {"Authority": "https://example.b2clogin.com/example.onmicrosoft.com/B2C_1_UserFlow1","ClientId": "88888888-8888-8888-abdf-888888888","ValidateAuthority": false  }}

This is my .csproj file:

<!--   remove useless contents     --><PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3"/><PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.3" PrivateAssets="all"/><PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="8.0.3"/>

When I clicked to login button, page navigated to "authentication/login". Here's the codes:

<AuthorizeView><Authorized>        Hello, @context.User.Identity?.Name!<button @onclick="BeginLogOut">Log out</button></Authorized><NotAuthorized><a href="authentication/login">Log in</a></NotAuthorized></AuthorizeView>

I want my project to redirect to right URL.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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