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):
- https://localhost/authentication/login-callback (for development)
- https://www.example.com/authentication/login-callback (for production)
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.