Angular-auth-oidc-client: Auto Login

Created on 19 Sep 2017  路  4Comments  路  Source: damienbod/angular-auth-oidc-client

Hey,

Great work, I really like this library.

I was wondering if you have a method for forcing login when the Angular app starts. I tried using a Guard and calling _.authorize()_, but I ended up in a huge loop, where the call to _.getIsAuthorized()_ wasn't initialised before I the guard called _.authorize()_ again. :(

The same code with a button calling _.authorize()_ works perfectly.

FYI - In my loop I was seeing a lot of incorrect nonce errors which was a huge red herring.

Thanks

Brent

question

All 4 comments

thanks, I'll have a look this week. (I have to implement this for a client this week.)

Greetings Damien

@brentos99 @tcrite

Hi Brent

I've implement this here:

https://github.com/damienbod/angular-auth-oidc-sample-google-openid/blob/master/src/AngularClient/angularApp/app/app.component.ts

And the auto-login component is required for the login redirect.

Also:
openIDImplicitFlowConfiguration.trigger_authorization_result_event = true;

Will blog about it when I get a chance.

Greetings Damien

@brentos99 Can I close this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hannesrohde picture hannesrohde  路  3Comments

sdev95 picture sdev95  路  3Comments

toddtsic picture toddtsic  路  4Comments

mustafakachwala picture mustafakachwala  路  4Comments

revok picture revok  路  4Comments