mirror of
https://github.com/bitwarden/browser
synced 2026-02-08 12:40:26 +00:00
* feat: add Identity Sso Required Response type as possible response from token endpoint. * feat: consume sso organization identifier to redirect user * feat: add get requiresSso to AuthResult for more ergonomic code. * feat: sso-redirect on sso-required for CLI and Desktop * chore: fixing type errors * test: fix and add tests for new sso method * docs: fix misspelling * fix: get email from AuthResult instead of the FormGroup * fix:claude: when email is not available for SSO login show error toast. * fix:claude: add null safety check
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
// FIXME: Update this file to be type safe and remove this and next line
|
|
// @ts-strict-ignore
|
|
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
|
|
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
|
|
|
export interface PasswordPolicies {
|
|
policies: Policy[];
|
|
isPolicyAndAutoEnrollEnabled: boolean;
|
|
enforcedPasswordPolicyOptions: MasterPasswordPolicyOptions;
|
|
}
|
|
|
|
/**
|
|
* The `LoginComponentService` allows the single libs/auth `LoginComponent` to
|
|
* delegate all client-specific functionality to client-specific service
|
|
* implementations of `LoginComponentService`.
|
|
*
|
|
* The `LoginComponentService` should not be confused with the
|
|
* `LoginStrategyService`, which is used to determine the login strategy and
|
|
* performs the core login logic.
|
|
*/
|
|
export abstract class LoginComponentService {
|
|
/**
|
|
* Gets the organization policies if there is an organization invite.
|
|
* - Used by: Web
|
|
*/
|
|
getOrgPoliciesFromOrgInvite?: (email: string) => Promise<PasswordPolicies | null>;
|
|
|
|
/**
|
|
* Indicates whether login with passkey is supported on the given client
|
|
*/
|
|
isLoginWithPasskeySupported: () => boolean;
|
|
|
|
/**
|
|
* Redirects the user to the SSO login page, either via route or in a new browser window.
|
|
*/
|
|
redirectToSsoLogin: (email: string) => Promise<void | null>;
|
|
|
|
/**
|
|
* Redirects the user to the SSO login page with organization SSO identifier, either via route or in a new browser window.
|
|
*/
|
|
redirectToSsoLoginWithOrganizationSsoIdentifier: (
|
|
email: string,
|
|
orgSsoIdentifier: string | null | undefined,
|
|
) => Promise<void | null>;
|
|
|
|
/**
|
|
* Shows the back button.
|
|
*/
|
|
showBackButton: (showBackButton: boolean) => void;
|
|
}
|