Closed smerliere closed 5 years ago
Sorry, angular routing is not my strong suit. However, the /auth-callback
path is where you need to receive and parse incoming tokens. Once things are validated and you create a user session, where you redirect off to is completely up to you.
So, maybe after completing completeAuthentication
, redirect the user to the page they were initially trying to access.
Hi Scott,
I actually work on a web project with Angular and I would add some Identity Server authentication on it.
I have somes questions related to redirection on redirect url after login.
Foremost, thank you for your example and your tutorial.
https://www.scottbrady91.com/Angular/SPA-Authentiction-using-OpenID-Connect-Angular-CLI-and-oidc-client
However I faced some troubles while putting it into practice.
I begin my process on my home page with this url :
http://localhost:4200/#/pages/dashboard
For the moment, I have no buttons to access the protected component. Also, I used this url to access protected component into my navigator :
http://localhost:4200/#/pages/protected
This url drove me well on identity server authentification page. However, after sign in, the returned url in navigator becomes :
http://localhost:4200/auth-callback#/pages/dashboard
Firstly, how can I avoid the insertion of "auth-callback" in the url ?
Secondly, I am not able to access to my protected page url
Indeed, when I tried to access it, it always redirect me on following url :
http://localhost:4200/auth-callback#/pages/dashboard
Instead of :
http://localhost:4200/auth-callback#/pages/protected
Did I miss something in my configuration ?
Config.cs file on Identity Server Side
auth.service.ts file on my angular web project :
auth-callback.component.ts file
Thank you in advance for your answer.