Skip to content

Auto redirect log in Identity Server #157

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

Closed
tuongntk opened this issue Nov 12, 2017 · 2 comments
Closed

Auto redirect log in Identity Server #157

tuongntk opened this issue Nov 12, 2017 · 2 comments

Comments

@tuongntk
Copy link

Hi all.

I love this library so much. So I've a question: How to auto redirect to login screen in Identity Server. At the current time when initializing the SPA you must click login() to init Implicit flow.
Any ideas for this.

Tks so much and best regards,

@manfredsteyer
Copy link
Owner

This should do the job:

            this.oauthService.loadDiscoveryDocumentAndTryLogin().then(_ => {
                if (!this.oauthService.hasValidIdToken() || !this.oauthService.hasValidAccessToken()) {
                  this.oauthService.initImplicitFlow();
                }
            });

This next version of this lib will have a convenience method for this:

this.oauthService.loadDiscoveryDocumentAndLogin()

@tuongntk
Copy link
Author

tks so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants