CDCUserAuthProvider
The CDCUserAuthProvider connects the Archibald AuthModule to the SAP Customer Data Cloud REST API.
Constructor
const provider = new CDCUserAuthProvider(options: CDCUserAuthProviderOptions);
Options
| Property | Type | Default | Description |
|---|---|---|---|
name | string | 'cdc' | The unique identifier for this provider instance. |
config | DefaultCDCConfig | DynamicPropertyAccessor | ✔️ CDC connection details (API Key, Data Center, etc.). |
Methods
initialize(server)
Registers the necessary CDC services (CDCHttpService, CDCAccountsService, etc.) to the server container.
login(credentials)
Performs a login using the cdcAccountsService.login and then exchanges the session for a JWE access token.
loadUser(tokens)
Retrieves the user profile from CDC by extracting the UID from the session token's sub claim.
refresh(refreshToken)
Exchanges a long-lived refresh token (cookie) for a new short-lived access token.
logout()
Calls the CDC accounts.logout endpoint to terminate the session on the provider side.
Relates to
AuthModule: This provider must be registered in theprovidersarray of theAuthModule.CDCAccountsService: Used internally for the core login and profile retrieval logic.