Skip to content

Commit

Permalink
Add AuthenticationMethod to AuthenticateResponse. (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
dezlitz authored Dec 6, 2024
1 parent 097a259 commit 505b263
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/usermanagement/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,21 @@ type AuthenticateWithOrganizationSelectionOpts struct {
UserAgent string `json:"user_agent,omitempty"`
}

// AuthenticationMethod represents the authentication method used to authenticate the user.
type AuthenticationMethod string

// Constants that enumerate the available authentication methods.
const (
SSO AuthenticationMethod = "SSO"
Password AuthenticationMethod = "Password"
AppleOAuth AuthenticationMethod = "AppleOAuth"
GitHubOAuth AuthenticationMethod = "GitHubOAuth"
GoogleOAuth AuthenticationMethod = "GoogleOAuth"
MicrosoftOAuth AuthenticationMethod = "MicrosoftOAuth"
MagicAuthAuthenticationMethod AuthenticationMethod = "MagicAuth"
Impersonation AuthenticationMethod = "Impersonation"
)

type Impersonator struct {
// The email address of the WorkOS Dashboard user using impersonation.
Email string `json:"email"`
Expand All @@ -328,6 +343,9 @@ type AuthenticateResponse struct {
// `AuthenticateWithRefreshToken`
RefreshToken string `json:"refresh_token"`

// The authentication method used to authenticate the user.
AuthenticationMethod AuthenticationMethod `json:"authentication_method"`

// Present if the authenticated user is being impersonated.
Impersonator *Impersonator `json:"impersonator"`
}
Expand Down

0 comments on commit 505b263

Please sign in to comment.