-
Notifications
You must be signed in to change notification settings - Fork 376
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
feat: add has verified factor mfa claim #1838
Conversation
@@ -108,6 +108,7 @@ type AccessTokenClaims struct { | |||
AuthenticatorAssuranceLevel string `json:"aal,omitempty"` | |||
AuthenticationMethodReference []models.AMREntry `json:"amr,omitempty"` | |||
SessionId string `json:"session_id,omitempty"` | |||
HasVerifiedFactor bool `json:"has_verified_factor"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be set to false if there are no factors / nil slice so there's no need for an omitempty specifier
Pull Request Test Coverage Report for Build 11811241578Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@J0 can we also add a test to check that the value in the claim is expected?
@@ -108,6 +108,7 @@ type AccessTokenClaims struct { | |||
AuthenticatorAssuranceLevel string `json:"aal,omitempty"` | |||
AuthenticationMethodReference []models.AMREntry `json:"amr,omitempty"` | |||
SessionId string `json:"session_id,omitempty"` | |||
HasVerifiedFactor bool `json:"has_verified_factor"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we call this mfa_enabled
? seems easier to understand vs has_verified_factor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should fix this in documentation if necessary. Essentially this change should be:
mfa_enabled := ("mfa" in token.amr)
If we are not currently populating AMR with RFC 8176 values, I think that would be a great change to make in place of this one.
Currently we don't use The above convention would work though though we'd need to make an exception for MFA methods:
|
Closing in favour of documentation, should evaluate RFC8176 at some point |
What kind of change does this PR introduce?
Supercedes #1823 and adds a
HasVerifiedFactor
claim so that it's easier to enforce aal2 only if MFA is enabled on a user's account. Naming is open for discussionAdditional context
Internally, prior to deploy, we will need to update tests (if any) to reflect that we have added a new claim. As this is an additive change, it should not break any existing setups