Auto Redirect for login
See original GitHub issueLibrary
-
msal@1.x.x
or@azure/msal@1.x.x
-
@azure/msal-browser@2.11.0
-
@azure/msal-node@1.x.x
-
@azure/msal-react@1.x.x
-
@azure/msal-angular@0.x.x
-
@azure/msal-angular@1.x.x
-
@azure/msal-angular@2.0.0-alpha.6
-
@azure/msal-angularjs@1.x.x
Description
I have followed this repos. In fact. I downloaded the code, added a controller to the API and am making calls to the new controller.
I would like to know if it’s possible in the Angular App to not have the user click on a login button to redirect to the Microsoft Login Page?
I have attempted this on my own in the angular app, by doing the following: In the app.component.ts file, in the ngOnInit() method. I added a call to this.login(); above the line this.checkAccount();
The angular app, will auto redirect to the Microsoft Login Page automatically, I can login and it will take me to the default page based on the routing map.
The odd behavior I see is once I’m on the default page if I click the browser refresh button, the page will just automatically start a refresh loop. It will do this refresh until you stop it. When it does this, I see in the console the error thats described in this issue: #3042
I have read through the comments and see where a MsalRedirectComponent has been introduced, would this solve my problem?
If so, can I get a link to a sample that uses the MsalRedirectComponent or the documentation for it? The comments in 3042 mention a linked sample page, but I don’t see a link.
I’m attaching my modified sample project for review.
Ideally I do not want the user to have to click a login button to get to the the Microsoft Login Page
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
/smacksownhead
Of course. Makes sense now. I was doing the right thing, then, but the hard way. Thanks.
@rellis-of-rhindleton @sidyes Thanks again for your feedback. We have just released a new version of
@azure/msal-angular
with updated guidance and samples regarding login on app load for path and hash routing, hope this helps. If you are still experiencing issues with this, please try out the new versions and open a new issue with your configuration and usage.