Overview
The Login Strategy Service manages different authentication methods and login flows. It provides a unified interface for authenticating users through various strategies including password, SSO, WebAuthn, API keys, and auth requests.LoginStrategyServiceAbstraction
Core service for managing authentication strategies and login flows.Properties
currentAuthType$
null if the session has timed out.
authenticationSessionTimeout$
true when the authentication session has expired.
Methods
getEmail()
null.
Returns: Promise<string | null> - Email address or null
getMasterPasswordHash()
null.
Returns: Promise<string | null> - Master password hash or null
getSsoEmail2FaSessionToken()
null.
Returns: Promise<string | null> - SSO email 2FA session token or null
See also: SsoLoginStrategyData.ssoEmail2FaSessionToken
getAccessCode()
null.
Returns: Promise<string | null> - Access code or null
getAuthRequestId()
null.
Returns: Promise<string | null> - Auth request ID or null
logIn()
credentials- Login credentials for the chosen authentication method
Promise<AuthResult> - Authentication result
logInTwoFactor()
logIn(), so that must be called first.
Parameters:
twoFactor- Two-factor authentication request
Promise<AuthResult> - Authentication result
Throws: Error if no session data is found
makePasswordPreLoginMasterKey()
masterPassword- User’s master passwordemail- User’s email address
Promise<MasterKey> - Generated master key
getPasswordPrelogin()
email- User’s email address
Promise<void>
logInNewDeviceVerification()
deviceVerificationOtp- Device verification one-time password
Promise<AuthResult> - Authentication result
Login Credential Types
PasswordLoginCredentials
email- User’s email addressmasterPassword- User’s master passwordtwoFactor- Optional two-factor authentication tokenmasterPasswordPoliciesFromOrgInvite- Optional master password policies from organization invite
SsoLoginCredentials
code- OAuth authorization codecodeVerifier- PKCE code verifierredirectUrl- OAuth redirect URLorgId- Organization IDemail- Optional email address (used for 2FA token lookup)twoFactor- Optional two-factor authentication token
UserApiLoginCredentials
clientId- API key client IDclientSecret- API key client secret
AuthRequestLoginCredentials
email- User’s email addressaccessCode- Access code from auth requestauthRequestId- Auth request IDdecryptedUserKey- Decrypted user key (if available)twoFactor- Optional two-factor authentication token
WebAuthnLoginCredentials
token- Authentication tokendeviceResponse- WebAuthn assertion response from the browserprfKey- Optional PRF key for key derivation
Login Strategy Base Class
LoginStrategy
Abstract base class for all login strategies. Implements common login flow logic.Methods
logIn()
logInTwoFactor()
twoFactor- Two-factor authentication request
Promise<AuthResult> - Authentication result with master password if available
Throws: Error if token request is undefined