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

core/authenticate: validate the identity profile #4545

Merged
merged 1 commit into from Sep 15, 2023

Conversation

calebdoxsey
Copy link
Contributor

Summary

Validate the identity profile by checking that the oauth token is still valid and calling the user info endpoint. If the access token has been revoked that call should fail and the identity profile will be treated as if it doesn't exist. This will then trigger the re-authentication flow.

Related issues

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey requested a review from a team as a code owner September 15, 2023 18:48
@calebdoxsey calebdoxsey added bug Something isn't working backport 0-23-0 labels Sep 15, 2023
@coveralls
Copy link

Coverage Status

coverage: 63.914% (-0.08%) from 63.992% when pulling bd7df21 on cdoxsey/authenticate-validate-tokens into 723bd91 on main.

}

if !oauthToken.Valid() {
return fmt.Errorf("invalid oauth token in profile")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can AccessToken be missing or it's just expiration condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can be missing, but I'm not sure.

@calebdoxsey calebdoxsey merged commit e5a7b99 into main Sep 15, 2023
11 checks passed
@calebdoxsey calebdoxsey deleted the cdoxsey/authenticate-validate-tokens branch September 15, 2023 20:16
calebdoxsey added a commit that referenced this pull request Sep 15, 2023
core/authenticate: validate the identity profile (#4545)

Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 0-23-0 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants