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

Support Step-up authentication in OktaAuthGuard #132

Merged
merged 11 commits into from
Oct 23, 2023

Conversation

denysoblohin-okta
Copy link
Collaborator

Description

Added support of Step-up authentication in OktaAuthGuard by specifying acrValues in route data.
If current token does not have requested level of assurance, there will be a redirect to /authorize endpoint with provided acr_values in query parameters
Minimum supported version of okta-auth-js for this feature is 7.1.0
Changes for test apps:

  • added 2 buttons: "Step-up Route (1fa)" (protected route, requires any factor) and "Step-up Route (2fa)" (protected route, requires 2 factors)
  • changed protected component: now it renders user info and token claims (to check acr claim)

Resolves #125
Internal ref: OKTA-597151

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Adding Tests
  • Build related changes
  • CI related changes
  • Documentation changes
  • Other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

@@ -100,22 +105,46 @@ export class OktaAuthGuard implements CanActivate, CanActivateChild, CanLoad {
return this.canActivate(route, state);
}

private async handleLogin(originalUri?: string): Promise<void> {
private async isAuthenticated(routeData?: Data, authState?: AuthState | null) {

Choose a reason for hiding this comment

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

Should canActivateChild also have this check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

yep, gotcha, just had to actually look better. Thanks!

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

Successfully merging this pull request may close these issues.

Support Step Up with acr_values
4 participants