-
Notifications
You must be signed in to change notification settings - Fork 26
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
Authentication data lost after Keycloak redirects back to the app #14
Comments
Hi, In my case, the keycloak is initialized in the ngOnInit() :
Check your routing module configuration (useHash param) :
|
Hello, My code look like-
Routing moduel-
module.ts-
Virsions:
......................... |
Hi, @ebondu, the oauth parameters disappear before page loading, at least in my app. I tracked back the problem to the asynchronous load of the keycloak.json configuration file and therefore the remaining part of the initialization process. I made it synchronous (hardcoded the configuration for now) and it works like a charm. The initOptions I'm using now are below, and changed the routing to
I need further customization of the http proxy as my app requires three types of http requests and the current proxy only supports two (first and third):
|
Could be a little late, but I secured my application using a guard and an interceptor. In my example, I'm supporting multi-tenant using 'realm' as a part of my URL. |
Hi,
I'm trying to make this module work in my starter project but I hit some walls.
After doing some debugging and googling I came to the conclusion that after Keycloak redirects back to the application, all authentication parameters from the URL (code, state) are stripped by Angular so
Keycloak.parseCallback
andKeycloak.processCallback
functions are unable to initialize the Keycloak object properly.I tried to put the Keycloak initialization in a module constructor (link) so it runs before Angular strips the URL but
Keycloak.prototype.processInit
being called asynchronously (afterkeycloak.json
is loaded) by the time it runs, the URL is stripped.Maybe the initialization should be done synchronously? Or am missing something?
I used the following initOptions:
Could someone please provide a working example?
Thank you!
The text was updated successfully, but these errors were encountered: