Skip to content

Non-standard redirect address for Login #61017

@KurtP20

Description

@KurtP20

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I started with a Blazor Template with Authentication and added MS as an external authentication provider. When I enter the redirect URL https://localhost:7274/signin-oidc on Azure App registration, it get an error AADSTS900971: No reply address provided.

cc: @guardrex dotnet/AspNetCore.Docs#34992

Expected Behavior

I expect that /signin-oidc is the correct return address as mentioned here under Web platform.

Login works if I manually add the return path like:

builder.Services.AddAuthentication(...)
    .AddMicrosoftAccount(microsoftOptions =>
    {
        microsoftOptions.ClientId = builder.Configuration["Authentication:Microsoft:ClientId"];
        microsoftOptions.ClientSecret = builder.Configuration["Authentication:Microsoft:ClientSecret"];
        var tenantId = builder.Configuration["Authentication:Microsoft:TenantId"];
        microsoftOptions.AuthorizationEndpoint = $"https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize";
        microsoftOptions.TokenEndpoint = $"https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
        microsoftOptions.CallbackPath = new PathString("/signin-oidc");
    })
    .AddIdentityCookies();

Maybe the way I specify the TenantId is causing the issue, but I could not find more documentation on this. As far as I can tell, /signin-oidc is not the standard return path.

Steps To Reproduce

  • Start from a Blazor Web App template with Authentication,
  • add Microsoft.AspNetCore.Authentication.MicrosoftAccount NuGet,
  • register https://localhost:7274/signin-oidc as a return address in Azure App registration,
  • add Microsoft Authentication provider in Program.cs as stated above.

When logging in, I got the above error.

Here is the repo, just add user secrets: https://github.com/KurtP20/testReturnAdr

Exceptions (if any)

No response

.NET Version

9.0.201

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions