Skip to main content

CDCUserAuthProvider

The CDCUserAuthProvider connects the Archibald AuthModule to the SAP Customer Data Cloud REST API.

Constructor

const provider = new CDCUserAuthProvider(options: CDCUserAuthProviderOptions);

Options

PropertyTypeDefaultDescription
namestring'cdc'The unique identifier for this provider instance.
configDefaultCDCConfig | 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 the providers array of the AuthModule.
  • CDCAccountsService: Used internally for the core login and profile retrieval logic.