I have an app hosted on Azure PaaS using Open ID Connect for auth.
The app URL is like: https://env.app.entity.my.domain
The Azure ASE is: https://entity-app-env-web.webenvase.my.domain
As long as I configure a redirect URI for https://entity-app-env-web.webenvase.my.domain/signin-oidc in Azure, it works. That's because it's ignoring the redirect URI in my settings. But that's not what I want. I will obviously want to return the user to the app's URL.
No matter what values I put for my RedirectUri
or CallbackPath
, it defaults to the ASE URL. How can I fix that?
appsettings.json
:
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Issuer": "https://sts.windows.net/<tenant id>/",
"Domain": "my.azure.domain",
"TenantId": "<tenant id>",
"ClientId": "<client id>",
"RedirectUri": "https://env.app.entity.my.domain/signin-oidc"
}
Startup.cs
(auth config):
services.AddMicrosoftIdentityWebAppAuthentication(Configuration);
services.AddControllersWithViews(options =>
{
var policy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.RequireRole(Role.Administrator)
.Build();
options.Filters.Add(new AuthorizeFilter(policy));
})
.AddMicrosoftIdentityUI();