feat(auth): add AlbertSSOTokenExchange for server-to-server OIDC token exchange#509
feat(auth): add AlbertSSOTokenExchange for server-to-server OIDC token exchange#509prasad-albert wants to merge 4 commits into
Conversation
Code ReviewIssues Found
Summary2 issues found. Neither is runtime-critical, but the |
Adds a new auth strategy for applications that authenticate users via Azure AD and want to access the Albert API without browser interaction. - AlbertSSOTokenExchange exchanges an Azure AD ID token for an Albert access token via POST /api/v3/login/sso/exchange; accepts an oidc_token_provider callable so tokens are re-fetched on renewal - Uses expires_in from response to schedule refresh; falls back to 55 min until backend ships the field - Albert.from_sso_exchange() and AsyncAlbert.from_sso_exchange() factory methods; AlbertSSOTokenExchange exported from top-level albert package - Docs: sso_exchange.md API reference, Azure AD section in authentication.md with prerequisites and warnings, mkdocs.yml nav entry
75d62e8 to
a2dd94f
Compare
Remove Azure AD-specific framing — the exchange endpoint supports any IdP that emits preferred_username (Okta, Auth0, Cognito, Keycloak, Ping, etc). Add provider compatibility table, Google claim-mapping warning, and SAML exclusion note in docs. Update code docstrings accordingly.
@claude all issues have been addressed. |
|
Claude finished @prasad-albert's task in 48s —— View job Verification Complete
Both previously identified issues are resolved:
The code is clean and ready to merge. |
Summary
AlbertSSOTokenExchangeauth manager — exchanges an OIDC ID token for an Albert access token without browser interaction, usingPOST /api/v3/login/sso/exchangepreferred_username(Okta, Auth0, Entra ID, Cognito, Keycloak, etc.); usesexpires_infrom response to schedule refresh (falls back to 55 min until backend ships the field)Albert.from_sso_exchange()andAsyncAlbert.from_sso_exchange()factory methods added;AlbertSSOTokenExchangeexported from top-levelalbertpackagesso_exchange.mdAPI reference, OIDC Token Exchange section inauthentication.mdwith provider compatibility table, Google claim-mapping warning, SAML exclusion note, and usage examples