Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperLogin<ConfigParameters>

Enable shoppers to log in more easily, stay logged in for longer, and get a more fluid and personalized shopping experience powered by Shopper APIs.

Simple example:

  import { ShopperLogin } from "commerce-sdk-isomorphic";

  const clientConfig = {
    parameters: {
      clientId: "XXXXXX",
      organizationId: "XXXX",
      shortCode: "XXX",
      siteId: "XX"
    }
  };
  const shopperLoginClient = new ShopperLogin(clientConfig);
API Version: 1.39.22
Last Updated:

Type parameters

Hierarchy

  • ShopperLogin

Index

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/{version}"

Static Readonly paramKeys

paramKeys: { authenticateCustomer: ["organizationId"]; authenticateCustomerRequired: ["organizationId"]; authorizeCustomer: ["organizationId", "redirect_uri", "response_type", "client_id", "scope", "state", "usid", "hint", "channel_id", "code_challenge", "ui_locales"]; authorizeCustomerRequired: ["organizationId", "redirect_uri", "response_type", "client_id", "code_challenge"]; authorizePasswordlessCustomer: ["organizationId"]; authorizePasswordlessCustomerRequired: ["organizationId"]; getAccessToken: ["organizationId"]; getAccessTokenRequired: ["organizationId"]; getJwksUri: ["organizationId"]; getJwksUriRequired: ["organizationId"]; getPasswordLessAccessToken: ["organizationId"]; getPasswordLessAccessTokenRequired: ["organizationId"]; getPasswordResetToken: ["organizationId"]; getPasswordResetTokenRequired: ["organizationId"]; getSessionBridgeAccessToken: ["organizationId"]; getSessionBridgeAccessTokenRequired: ["organizationId"]; getTrustedAgentAccessToken: ["organizationId"]; getTrustedAgentAccessTokenRequired: ["organizationId"]; getTrustedAgentAuthorizationToken: ["organizationId", "client_id", "channel_id", "code_challenge", "login_id", "idp_origin", "redirect_uri", "response_type"]; getTrustedAgentAuthorizationTokenRequired: ["organizationId", "client_id", "channel_id", "code_challenge", "login_id", "idp_origin", "redirect_uri", "response_type"]; getTrustedSystemAccessToken: ["organizationId"]; getTrustedSystemAccessTokenRequired: ["organizationId"]; getUserInfo: ["organizationId", "channel_id"]; getUserInfoRequired: ["organizationId"]; getWellknownOpenidConfiguration: ["organizationId"]; getWellknownOpenidConfigurationRequired: ["organizationId"]; introspectToken: ["organizationId"]; introspectTokenRequired: ["organizationId"]; logoutCustomer: ["organizationId", "client_id", "refresh_token", "channel_id", "hint"]; logoutCustomerRequired: ["organizationId", "client_id", "refresh_token"]; resetPassword: ["organizationId"]; resetPasswordRequired: ["organizationId"]; revokeToken: ["organizationId"]; revokeTokenRequired: ["organizationId"] } = {authenticateCustomer: ['organizationId',],authenticateCustomerRequired: ['organizationId',],authorizePasswordlessCustomer: ['organizationId',],authorizePasswordlessCustomerRequired: ['organizationId',],logoutCustomer: ['organizationId','client_id','refresh_token','channel_id','hint',],logoutCustomerRequired: ['organizationId','client_id','refresh_token',],authorizeCustomer: ['organizationId','redirect_uri','response_type','client_id','scope','state','usid','hint','channel_id','code_challenge','ui_locales',],authorizeCustomerRequired: ['organizationId','redirect_uri','response_type','client_id','code_challenge',],getAccessToken: ['organizationId',],getAccessTokenRequired: ['organizationId',],getSessionBridgeAccessToken: ['organizationId',],getSessionBridgeAccessTokenRequired: ['organizationId',],getTrustedSystemAccessToken: ['organizationId',],getTrustedSystemAccessTokenRequired: ['organizationId',],getTrustedAgentAuthorizationToken: ['organizationId','client_id','channel_id','code_challenge','login_id','idp_origin','redirect_uri','response_type',],getTrustedAgentAuthorizationTokenRequired: ['organizationId','client_id','channel_id','code_challenge','login_id','idp_origin','redirect_uri','response_type',],getTrustedAgentAccessToken: ['organizationId',],getTrustedAgentAccessTokenRequired: ['organizationId',],getPasswordResetToken: ['organizationId',],getPasswordResetTokenRequired: ['organizationId',],resetPassword: ['organizationId',],resetPasswordRequired: ['organizationId',],getPasswordLessAccessToken: ['organizationId',],getPasswordLessAccessTokenRequired: ['organizationId',],revokeToken: ['organizationId',],revokeTokenRequired: ['organizationId',],introspectToken: ['organizationId',],introspectTokenRequired: ['organizationId',],getUserInfo: ['organizationId','channel_id',],getUserInfoRequired: ['organizationId',],getWellknownOpenidConfiguration: ['organizationId',],getWellknownOpenidConfigurationRequired: ['organizationId',],getJwksUri: ['organizationId',],getJwksUriRequired: ['organizationId',],} as const

Type declaration

  • authenticateCustomer: ["organizationId"]
  • authenticateCustomerRequired: ["organizationId"]
  • authorizeCustomer: ["organizationId", "redirect_uri", "response_type", "client_id", "scope", "state", "usid", "hint", "channel_id", "code_challenge", "ui_locales"]
  • authorizeCustomerRequired: ["organizationId", "redirect_uri", "response_type", "client_id", "code_challenge"]
  • authorizePasswordlessCustomer: ["organizationId"]
  • authorizePasswordlessCustomerRequired: ["organizationId"]
  • getAccessToken: ["organizationId"]
  • getAccessTokenRequired: ["organizationId"]
  • getJwksUri: ["organizationId"]
  • getJwksUriRequired: ["organizationId"]
  • getPasswordLessAccessToken: ["organizationId"]
  • getPasswordLessAccessTokenRequired: ["organizationId"]
  • getPasswordResetToken: ["organizationId"]
  • getPasswordResetTokenRequired: ["organizationId"]
  • getSessionBridgeAccessToken: ["organizationId"]
  • getSessionBridgeAccessTokenRequired: ["organizationId"]
  • getTrustedAgentAccessToken: ["organizationId"]
  • getTrustedAgentAccessTokenRequired: ["organizationId"]
  • getTrustedAgentAuthorizationToken: ["organizationId", "client_id", "channel_id", "code_challenge", "login_id", "idp_origin", "redirect_uri", "response_type"]
  • getTrustedAgentAuthorizationTokenRequired: ["organizationId", "client_id", "channel_id", "code_challenge", "login_id", "idp_origin", "redirect_uri", "response_type"]
  • getTrustedSystemAccessToken: ["organizationId"]
  • getTrustedSystemAccessTokenRequired: ["organizationId"]
  • getUserInfo: ["organizationId", "channel_id"]
  • getUserInfoRequired: ["organizationId"]
  • getWellknownOpenidConfiguration: ["organizationId"]
  • getWellknownOpenidConfigurationRequired: ["organizationId"]
  • introspectToken: ["organizationId"]
  • introspectTokenRequired: ["organizationId"]
  • logoutCustomer: ["organizationId", "client_id", "refresh_token", "channel_id", "hint"]
  • logoutCustomerRequired: ["organizationId", "client_id", "refresh_token"]
  • resetPassword: ["organizationId"]
  • resetPasswordRequired: ["organizationId"]
  • revokeToken: ["organizationId"]
  • revokeTokenRequired: ["organizationId"]

Methods

authenticateCustomer

  • Logs in a shopper with credentials that are managed by a B2C Commerce instance (ECOM). It follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).

    For PKCE values:

    • The code_verifier string is a random string used for the /token endpoint request.
    • The code_challenge is an encoded version of the code_verifier string using an SHA-256 hash.

    The request must include a basic authorization header that contains a Base64 encoded version of the following string: \<shopperUserID\>:\<shopperPassword\>.

    Required parameters: code_challenge, channel_id, client_id, and redirect_uri.

    Optional parameters: usid.

    The SLAS /login endpoint redirects back to the redirect URI and returns an authorization code.

    Calls to /login made with the same loginId and tenantId within 1 second will result in a conflict.

    If you would like to get a raw Response object use the other authenticateCustomer function.

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Logs in a shopper with credentials that are managed by a B2C Commerce instance (ECOM). It follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).

    For PKCE values:

    • The code_verifier string is a random string used for the /token endpoint request.
    • The code_challenge is an encoded version of the code_verifier string using an SHA-256 hash.

    The request must include a basic authorization header that contains a Base64 encoded version of the following string: \<shopperUserID\>:\<shopperPassword\>.

    Required parameters: code_challenge, channel_id, client_id, and redirect_uri.

    Optional parameters: usid.

    The SLAS /login endpoint redirects back to the redirect URI and returns an authorization code.

    Calls to /login made with the same loginId and tenantId within 1 second will result in a conflict.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

authorizeCustomer

  • authorizeCustomer(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; code_challenge: string; hint?: undefined | string; organizationId: string; redirect_uri: string; response_type: string; scope?: undefined | string; state?: undefined | string; ui_locales?: undefined | string; usid?: undefined | string } & {}, ConfigParameters> }>): Promise<void>
  • authorizeCustomer<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; code_challenge: string; hint?: undefined | string; organizationId: string; redirect_uri: string; response_type: string; scope?: undefined | string; state?: undefined | string; ui_locales?: undefined | string; usid?: undefined | string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : void>
  • Get an authorization code after authenticating a user against an identity provider (IDP). This is the first step of the OAuth 2.1 authorization code flow, where a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.

    This endpoint can be called from the front channel (the browser).

    If you would like to get a raw Response object use the other authorizeCustomer function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; code_challenge: string; hint?: undefined | string; organizationId: string; redirect_uri: string; response_type: string; scope?: undefined | string; state?: undefined | string; ui_locales?: undefined | string; usid?: undefined | string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Get an authorization code after authenticating a user against an identity provider (IDP). This is the first step of the OAuth 2.1 authorization code flow, where a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.

    This endpoint can be called from the front channel (the browser).

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; code_challenge: string; hint?: undefined | string; organizationId: string; redirect_uri: string; response_type: string; scope?: undefined | string; state?: undefined | string; ui_locales?: undefined | string; usid?: undefined | string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

authorizePasswordlessCustomer

  • Allows the customer to authenticate when their identity provider is down.

    If you would like to get a raw Response object use the other authorizePasswordlessCustomer function.

    Parameters

    Returns Promise<Object>

    A promise of type Object.

  • Allows the customer to authenticate when their identity provider is down.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getAccessToken

  • Get the shopper or guest JWT access token and a refresh token. This is the second step of the OAuth 2.1 authorization code flow.

    For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the authorize endpoint.

    For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.

    For a public client using PKCE, an application will pass a PKCE code_verifier that matches the code_challenge that was used to authorize the customer along with the authorization code.

    When refreshing the access token with a private client ID and client secret, the refresh token is not regenerated. However, when refreshing the access token with a public client ID, the refresh token is always regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client needs to be replaced to always store the new refresh token.

    See the Body section for required parameters, including grant_type and others, depending on the value of grant_type.

    Important: We strongly recommended using the channel_id query parameter because *it will be required in the future.

    If you would like to get a raw Response object use the other getAccessToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Get the shopper or guest JWT access token and a refresh token. This is the second step of the OAuth 2.1 authorization code flow.

    For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the authorize endpoint.

    For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.

    For a public client using PKCE, an application will pass a PKCE code_verifier that matches the code_challenge that was used to authorize the customer along with the authorization code.

    When refreshing the access token with a private client ID and client secret, the refresh token is not regenerated. However, when refreshing the access token with a public client ID, the refresh token is always regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client needs to be replaced to always store the new refresh token.

    See the Body section for required parameters, including grant_type and others, depending on the value of grant_type.

    Important: We strongly recommended using the channel_id query parameter because *it will be required in the future.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

getJwksUri

  • Returns a JSON Web Key Set (JWKS) containing the current, past, and future public keys. The key set enables clients to validate the Shopper JSON Web Token (JWT) issued by SLAS.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    If you would like to get a raw Response object use the other getJwksUri function.

    Parameters

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON Web Key Set (JWKS) containing the current, past, and future public keys. The key set enables clients to validate the Shopper JSON Web Token (JWT) issued by SLAS.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ organizationId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getPasswordLessAccessToken

  • Issue a shopper token (JWT).

    If you would like to get a raw Response object use the other getPasswordLessAccessToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Issue a shopper token (JWT).

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

getPasswordResetToken

  • Request a reset password token

    If you would like to get a raw Response object use the other getPasswordResetToken function.

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Request a reset password token

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

getSessionBridgeAccessToken

  • Get a shopper JWT access token for a registered customer using session bridge.

    For public client id requests the grant_type must be set to session_bridge.

    For private client_id and secret the grant_type must be set to client_credentials along with a basic authorization header.

    DEPRECATED* - As of January 31, 2024, SLAS will no longer support the SESB dwsid parameter for guest users for session-bridge/token calls. It is recommended to transition over to using a SESB dwsgst token.

    The dwsid will still be needed for registered user session-bridge/token calls.

    If you would like to get a raw Response object use the other getSessionBridgeAccessToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Get a shopper JWT access token for a registered customer using session bridge.

    For public client id requests the grant_type must be set to session_bridge.

    For private client_id and secret the grant_type must be set to client_credentials along with a basic authorization header.

    DEPRECATED* - As of January 31, 2024, SLAS will no longer support the SESB dwsid parameter for guest users for session-bridge/token calls. It is recommended to transition over to using a SESB dwsgst token.

    The dwsid will still be needed for registered user session-bridge/token calls.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

getTrustedAgentAccessToken

  • Get a shopper JWT access token for a registered customer using a trusted agent (merchant).

    If using a SLAS private client ID, you must also use an _sfdc_client_auth header.

    The value of the _sfdc_client_auth header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (:). For example, privateClientId:privateClientsecret becomes cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ= after Base64 encoding.

    If you would like to get a raw Response object use the other getTrustedAgentAccessToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Get a shopper JWT access token for a registered customer using a trusted agent (merchant).

    If using a SLAS private client ID, you must also use an _sfdc_client_auth header.

    The value of the _sfdc_client_auth header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (:). For example, privateClientId:privateClientsecret becomes cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ= after Base64 encoding.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

getTrustedAgentAuthorizationToken

  • getTrustedAgentAuthorizationToken(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId: string; redirect_uri: string; response_type: string } & {}, ConfigParameters> }>): Promise<void>
  • getTrustedAgentAuthorizationToken<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId: string; redirect_uri: string; response_type: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : void>
  • Obtains a new agent on behalf authorization token for a registered customer.

    If you would like to get a raw Response object use the other getTrustedAgentAuthorizationToken function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId: string; redirect_uri: string; response_type: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<void>

    A promise of type void.

  • Obtains a new agent on behalf authorization token for a registered customer.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId: string; redirect_uri: string; response_type: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

getTrustedSystemAccessToken

  • Get a shopper JWT access token for a registered customer whose credentials are stored using a third party system.

    For trusted-system requests, a basic authorization header that includes a SLAS client ID and SLAS client secret can be used in place of the bearer token.

    If you would like to get a raw Response object use the other getTrustedSystemAccessToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Get a shopper JWT access token for a registered customer whose credentials are stored using a third party system.

    For trusted-system requests, a basic authorization header that includes a SLAS client ID and SLAS client secret can be used in place of the bearer token.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

getUserInfo

  • Returns a JSON listing of claims about the currently authenticated user.

    If you would like to get a raw Response object use the other getUserInfo function.

    Parameters

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON listing of claims about the currently authenticated user.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; organizationId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getWellknownOpenidConfiguration

  • Returns a JSON listing of the OpenID/OAuth endpoints, supported scopes and claims, public keys used to sign the tokens, and other details.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    If you would like to get a raw Response object use the other getWellknownOpenidConfiguration function.

    Parameters

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON listing of the OpenID/OAuth endpoints, supported scopes and claims, public keys used to sign the tokens, and other details.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ organizationId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

introspectToken

  • Returns the token properties. A basic auth header with Base64-encoded clientId:secret is required in the Authorization header, as well as an access token or refresh token. Use token_type_hint to help identify the token.

    If you would like to get a raw Response object use the other introspectToken function.

    Parameters

    Returns Promise<Object>

    A promise of type Object.

  • Returns the token properties. A basic auth header with Base64-encoded clientId:secret is required in the Authorization header, as well as an access token or refresh token. Use token_type_hint to help identify the token.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

logoutCustomer

  • logoutCustomer(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; hint?: undefined | string; organizationId: string; refresh_token: string } & {}, ConfigParameters> }>): Promise<TokenResponse>
  • logoutCustomer<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; hint?: undefined | string; organizationId: string; refresh_token: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>
  • Log out a shopper. The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (ECOM) instance, the OCAPI JWT is also revoked. This should be called for Registered users that have logged in using SLAS. his should be called for registered users that have logged in using SLAS. This endpoint is not for use with guest users.

    Required header: Authorization header bearer token of the Shopper access token to logout.

    Required parameters: refresh token, channel_id, and client.

    If you would like to get a raw Response object use the other logoutCustomer function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; hint?: undefined | string; organizationId: string; refresh_token: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Log out a shopper. The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (ECOM) instance, the OCAPI JWT is also revoked. This should be called for Registered users that have logged in using SLAS. his should be called for registered users that have logged in using SLAS. This endpoint is not for use with guest users.

    Required header: Authorization header bearer token of the Shopper access token to logout.

    Required parameters: refresh token, channel_id, and client.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ channel_id?: undefined | string; client_id: string; hint?: undefined | string; organizationId: string; refresh_token: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

resetPassword

  • Creates a new password

    If you would like to get a raw Response object use the other resetPassword function.

    Parameters

    Returns Promise<void>

    A promise of type void.

  • Creates a new password

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

revokeToken

  • Invalidate the refresh token. A basic auth header with Base64-encoded clientId:secret is required in the Authorization header, and the refresh token to be revoked is required in the body.

    If you would like to get a raw Response object use the other revokeToken function.

    Parameters

    Returns Promise<TokenResponse>

    A promise of type TokenResponse.

  • Invalidate the refresh token. A basic auth header with Base64-encoded clientId:secret is required in the Authorization header, and the refresh token to be revoked is required in the body.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.

Generated using TypeDoc