Skip to content

Commit

Permalink
Use a separate const name for "unsupported/unknown MFA factors"
Browse files Browse the repository at this point in the history
  • Loading branch information
boarnoah committed Jul 8, 2024
1 parent 19413d4 commit 2dcb2b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/D2L.Bmx/Okta/Models/AuthenticateResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ internal record OktaMfaFactor {
public required string Provider { get; set; }
public required string VendorName { get; set; }

public const string FactorType = "unknown";
public const string UnsupportedMfaFactor = "unknown";

[JsonIgnore]
public virtual string FactorName => "unknown";
[JsonIgnore]
Expand Down
2 changes: 1 addition & 1 deletion src/D2L.Bmx/OktaAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bool ignoreCache
if( authnResponse is AuthenticateResponse.MfaRequired mfaInfo ) {
OktaMfaFactor mfaFactor = consolePrompter.SelectMfa( mfaInfo.Factors );

if( mfaFactor.FactorName == OktaMfaFactor.FactorType ) {
if( mfaFactor.FactorName == OktaMfaFactor.UnsupportedMfaFactor ) {
throw new BmxException( "Selected MFA not supported by BMX" );
}

Expand Down

0 comments on commit 2dcb2b7

Please sign in to comment.