Skip to content
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

Documentation about token refresh (code flow) not found #1129

Open
michaelbe812 opened this issue Sep 9, 2021 · 2 comments
Open

Documentation about token refresh (code flow) not found #1129

michaelbe812 opened this issue Sep 9, 2021 · 2 comments
Labels
docs Issues that involve improving or adding documentation.

Comments

@michaelbe812
Copy link
Contributor

Describe the bug
Not sure if bug report fits well. It's kinda documentation bug.

Referring to the documentation about silent-refresh, the link to token refresh leads to a 404: https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/token-refresh.md

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/silent-refresh.html
  2. Click on 'Token Refresh'

Expected behavior
The documentation about token refresh using code flow should be shown

@michaelbe812
Copy link
Contributor Author

PR submitted: #1130

@jeroenheijmans jeroenheijmans added the docs Issues that involve improving or adding documentation. label Sep 9, 2021
@lf-novelt
Copy link

lf-novelt commented Oct 14, 2021

I also struggled to implement the refresh_token flow properly, check how I did in my issue #1146 in the app.component.ts

Basic idea

  • check if access_token is still valid
  • check if refresh_token exists (if (this.authSvc.getRefreshToken())
    • if yes, remove invalid access_token to prevent the interceptor from using it and getting errors.
    • refresh the token with this.authSvc.refreshToken().catch(() => this.redirectToLogin())
    • catch any error in case refreshToken is expired -> redirect to login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues that involve improving or adding documentation.
Projects
None yet
Development

No branches or pull requests

3 participants