Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loginStartPage URL doesn't have # when HashLocationStrategy is used #782

Closed
1 of 5 tasks
aathithan opened this issue Jun 21, 2019 · 5 comments
Closed
1 of 5 tasks

loginStartPage URL doesn't have # when HashLocationStrategy is used #782

aathithan opened this issue Jun 21, 2019 · 5 comments
Assignees

Comments

@aathithan
Copy link

@aathithan aathithan commented Jun 21, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Browser:

  • Chrome version 75
  • Firefox version XX
  • IE version XX
  • Edge version XX
  • Safari version XX

Library version


Library version: 0.1.2



## Current behavior


When useHash is set to true in my angular App,
and I use MsalGuard for authenticating my application, 
after the login success and processing the token, it redirects back to my application with / (for example 'http://localhost:4200/dashboard')

## Expected behavior


Once the login is success and after processing the token, it should redirect to http://localhost:4200/#/dashboard

## Minimal reproduction of the problem with instructions

1. Setup Azure authentication in the angular app
2. Use MsalGuard in canActivate and useHash:true in routing
3. Host the app in a server where no URL rewriting is written for path. (like static web site on an Azure blob storage)
4. Open the route which requires authentication
5. After the login success, you will see it goes to / which throws 404. it should have been /#/ 

@sameerag
Copy link
Member

@sameerag sameerag commented Jun 21, 2019

@negoe Can you help with the AAD requirement here? Do we support # in the reply URL?

@negoe
Copy link
Collaborator

@negoe negoe commented Jun 21, 2019

@aathithan Hi Archana, Who is your target audiene? We do not support fragments in reply URL for AAD+MSA audience. It is supported for AAD only.
cc @sameerag

@sameerag
Copy link
Member

@sameerag sameerag commented Jun 24, 2019

@aathithan Can you please confirm what is the target audience in your case?

@aathithan
Copy link
Author

@aathithan aathithan commented Jun 26, 2019

@sameerag and @negoe

I am using Azure B2C and msal.js in my angular app to provide authentication.
Once the login is success, I get the reply URL with fragment (for e.g. #state=)

But my concern here is, after processing the token, MSALGuard is redirecting to http://localhost:4200/dashboard instead of http://localhost:4200/#/dashboard.
PLEASE NOTE THE # in the URL.

@negoe
Copy link
Collaborator

@negoe negoe commented Jun 28, 2019

@aathithan The # you are getting in the response is not part of the reply url, but a delimiter. MSAL and B2C both do not support fragments in reply url. You can't register your B2C app on portal with this 'http://localhost:4200/#/dashboard'.

@negoe negoe closed this as completed Jun 28, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants