Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "goransund"

I've started on a new project with ASP.NET Core and Angular from template version 7.2.3. The Angular application will be deployed to a Azure Storage Static site according to https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Step-by-step-publish-to-azure-angular-staticsite. Therefore I had to enable hash location strategy to get it to work, by setting { useHash: true } in RouterModule.forRoot(routes). If that is the case you should add that to the documentation. If not, am I missing something here?

Azure AD B2C will be used for authentication so I've enabled openid in appsettings.json. The authentication to the AD B2C works but when I get redirected from the AD the URL is something like https://localhost:4200/account/login#state=.... Angular then tries to find a route matching state and gives an error "ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'state'". If I use path location strategy then it works locally but it will not work when deployed to Azure.

By setting authConfig.customQueryParams = { "response_mode": "query"} in getOpenIdConnectConfig then the redirect URL becomes https://localhost:4200/account/login?state=... which does not produce any routing error. However I just get redirected to the login page after signing in to Azure AD B2C. I guess I need to change let state = UrlHelper.getQueryParametersUsingHash().state; to let state = UrlHelper.getQueryParameters().state; eventually in login.component.ts but I never get there. I tried to follow this, but then nothing happens for the initial request. Please help me in the right direction here.

Showing 1 to 1 of 1 entries