Skip to content

Commit

Permalink
Merge pull request #1227 from Versent/add_duo_mfa_to_onelogin
Browse files Browse the repository at this point in the history
Add Duo Duo Security to accepted OneLogin MFA options
  • Loading branch information
tinaboyce authored Feb 28, 2024
2 parents 1ff0243 + 2366a36 commit 4d3b437
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/provider/onelogin/onelogin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
IdentifierSmsMfa = "OneLogin SMS"
IdentifierTotpMfa = "Google Authenticator"
IdentifierYubiKey = "Yubico YubiKey"
IdentifierDuoSecurity = "Duo Duo Security"

MessageMFARequired = "MFA is required for this user"
MessageSuccess = "Success"
Expand All @@ -43,6 +44,7 @@ var (
IdentifierSmsMfa: "SMS",
IdentifierTotpMfa: "TOTP",
IdentifierYubiKey: "YUBIKEY",
IdentifierDuoSecurity: "DUO TOTP",
}
)

Expand Down Expand Up @@ -250,7 +252,7 @@ func verifyMFA(oc *Client, oauthToken, appID, host, resp string) (string, error)

switch mfaIdentifer {
// These MFA options doesn't need additional request (e.g. to send SMS or a push notification etc) since the user can generate the code using their MFA app of choice.
case IdentifierTotpMfa, IdentifierYubiKey:
case IdentifierTotpMfa, IdentifierYubiKey, IdentifierDuoSecurity:
break

default:
Expand Down Expand Up @@ -284,7 +286,7 @@ func verifyMFA(oc *Client, oauthToken, appID, host, resp string) (string, error)
}

switch mfaIdentifer {
case IdentifierSmsMfa, IdentifierTotpMfa, IdentifierYubiKey:
case IdentifierSmsMfa, IdentifierTotpMfa, IdentifierYubiKey, IdentifierDuoSecurity:
verifyCode := prompter.StringRequired("Enter verification code")
var verifyBody bytes.Buffer
err := json.NewEncoder(&verifyBody).Encode(VerifyRequest{AppID: appID, DeviceID: mfaDeviceID, StateToken: stateToken, OTPToken: verifyCode})
Expand Down
2 changes: 1 addition & 1 deletion saml2aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var MFAsByProvider = ProviderList{
"PingOne": []string{"Auto"}, // automatically detects PingID
"JumpCloud": []string{"Auto", "TOTP", "WEBAUTHN", "DUO", "PUSH"},
"Okta": []string{"Auto", "PUSH", "DUO", "SMS", "TOTP", "OKTA", "FIDO", "YUBICO TOKEN:HARDWARE", "SYMANTEC"}, // automatically detects DUO, SMS, ToTP, and FIDO
"OneLogin": []string{"Auto", "OLP", "SMS", "TOTP", "YUBIKEY"}, // automatically detects OneLogin Protect, SMS and ToTP
"OneLogin": []string{"Auto", "OLP", "SMS", "TOTP", "YUBIKEY", "DUO TOTP"}, // automatically detects OneLogin Protect, SMS and ToTP
"Authentik": []string{"Auto"},
"KeyCloak": []string{"Auto"}, // automatically detects ToTP
"GoogleApps": []string{"Auto"}, // automatically detects ToTP
Expand Down

0 comments on commit 4d3b437

Please sign in to comment.