question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot figure out how to get onAuthSuccess to fire?

See original GitHub issue

Hi, I need to log login and logout events so I’m using onAuthSuccess & onAuthLogout.

I cannot get onAuthSuccess to fire using keycloak.getKeycloakInstance().onAuthSuccess = ...

This approach works for onAuthLogout when I call clearToken().

I’m setting it like this:

keycloak.init(...).then(() => {
   // setting here
});

If I try to set before keycloak.init() the keycloak instance is not set.

I couldn’t see any way to pass the callbacks into keycloak.init() as config options.

Any advice appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mauriciovigolocommented, May 5, 2018

@abhishekkaura and @angular101

I’ve been working on a new example to show how to handle the keycloak events and I started to build it using angular 6, so I came across a bigger issue, regarding the angular versions. I expect to finish all the migration to angular 6 this weekend and also release the examples.

0reactions
mauriciovigolocommented, May 21, 2018

Just found a bug in KeycloakService while doing the example, related to the order to register the events.

@angular101, during the keycloak-js events tests, I discover that the only propagated event between tabs is the onAuthLogout. All the others don’t work between tabs. 😞

Thanks for reporting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating something on angular with an event from another ...
If I want to update something like the login name how should call this onAuthSuccess. Should I create a function outside of angular,...
Read more >
ngx-auth-firebaseui/Lobby - Gitter
I have a problem (angular v9, "ngx-auth-firebaseui": "^4.0.1") with i18n: ... In the console, I see the following: Uncaught Error: Network Error ....
Read more >
angular-auth-firebaseui - npm package - Snyk
This library is an angular module (including angular components and services) that allows to authenticate your users with your firebase project.
Read more >
Diff - ad20484e8e..a16189bedb - chromium/src - Git at Google
For simplicity, we'll - // use a default zero duration when we can't calculate a true value. - base::TimeTicks start_of_run = stopwatch.
Read more >
keycloak-angular: Versions - Openbase
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies ... #47 - bug - Cannot figure out how to get onAuthSuccess to fire?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found