microsoft-identity-web icon indicating copy to clipboard operation
microsoft-identity-web copied to clipboard

MicrosoftIdentityOption.ReturnUrlParameter does not appear to work

Open javiercn opened this issue 3 years ago • 2 comments


Issue moved from dotnet/aspnetcore#45024

  • Please respond to @ShaunCurtis.

From @ShaunCurtis on Friday, November 11, 2022 10:19:49 AM

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

[Most likely a documentation problem on how it works]

Context: Blazor Server Template with Authentication in VS2022. Application running in debug mode.

Relevant AppSettings section:

  "AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
      ... relevant Domain, Secret and ID parameters to make it work
    "ReturnUrlParameter": "custompath",
    "AccessDeniedPath": "/",
  },

Relevant Program Section:

            services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
                .AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"))
                   .EnableTokenAcquisitionToCallDownstreamApi(initialScopes)
                        .AddMicrosoftGraph(Configuration.GetSection("DownstreamApi"))
                        .AddInMemoryTokenCaches();

            services.AddAuthorization();

Run up the app and manually call

https://localhost:5001/MicrosoftIdentity/account/signin?custompath=%2fcounter

Expected Behavior

It should, if I understand the documentation correctly, run through the login process and then take me back to the counter page.

It doesn't, it returns to /. What am I missing from the documentation?

Steps To Reproduce

See the decription

Exceptions (if any)

No response

.NET Version

7.0.100

Anything else?

VS2022 Community Net6.0 Windows10 Blazor server template with Azure ADB2C Authentication.

javiercn avatar Nov 18 '22 09:11 javiercn


Issue moved from dotnet/aspnetcore#45024

  • Please respond to @javiercn.

From @javiercn on Friday, November 11, 2022 10:28:29 AM

@ShaunCurtis thanks for contacting us.

/cc @jmprieur

javiercn avatar Nov 18 '22 09:11 javiercn

Hello all, Is there any update on this? Seems it's been inactive for a month, now

SamVanhoutte avatar Dec 19 '22 08:12 SamVanhoutte

Sorry for not responding. I believe we were waiting for a repro. closing, but please reopen if this is an issue still with the 3.0.1 version. Thanks.

jennyf19 avatar Aug 21 '24 02:08 jennyf19