1
votes

I have created a asp.net mvc core web app and am trying to use Azure AD B2C. In the portal, the redirect urls are as follows:

Redirect URI: https://localhost:44319/signin-oidc

Logout URL: https://localhost:44319/signout-oidc

My App settings:

  "AzureAdB2C": {
    "Instance": "https://myApp.b2clogin.com/tfp/",
    "ClientId": "myClientId",
    "CallbackPath": "/signin-oidc",
    "SignedOutCallbackPath ": "/signout-oidc",
    "Domain": "myApp.onmicrosoft.com",
    "SignUpSignInPolicyId": "B2C_1_SignUpSignIn",
    "ResetPasswordPolicyId": "B2C_1_PasswordReset",
    "EditProfilePolicyId": ""
  }

My ConfigureServices():

services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme)
    .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options));

My Configure():

app.UseAuthentication();
app.UseAuthorization();

When I sign in on a page (not homepage), I am successfully logged in but redirected to home page. When I sign out, I am redirected to the Azure login page, but successfully signed out. None of the pages require authorization currently.

Am I missing something?

1

1 Answers

0
votes

i'm not sure what the question here is, if you're asking why is why are you being redirected to the azure login page, that's because it's set that way, the logout url isn't a redirect. its a url where microsoft sends a callback request to a handler on your app side to kill your session. Please have a read here: https://docs.microsoft.com/en-us/azure/active-directory-b2c/openid-connect#send-a-sign-out-request

if you want it to send the user back somewhere after a logout, then you would have to specify a 'post_logout_redirect_uri'

hope that answers the question, but I'm still not sure if that's the question.