younifyd
Menu

Authenticate Customer

Authenticate Customer

POST/organizations/{organizationId}/oauth2/login

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Authenticate Customer action (under Auth (SLAS)).
  3. Fill in the fields below, then reference the result from later steps as {{authenticateCustomer.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html#instance-types).

Headers

Authorizationstringrequired

Base64-encoded username and password for HTTP basic authentication

x-slas-client-authstring

Base64-encoded string of client credentials. The string is composed of a client ID and client secret, separated by a colon (`:`). For example, `clientId:clientSecret`. Don't add the string `"Basic"`. The `x-slas-client-auth` header is supported for SLAS private clients. When strict client auth is enabled for the client, requests without this header are rejected with a 401.

Request body

Enter the body as JSON in the step's Body field.

client_idstring

SLAS client ID. Required when the grant type is `authorization_code_pkce`.

response_typeany

Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).

redirect_uristringrequired

The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`

statestring

Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.

scopestring

Scopes to limit an application's access to a user's account.

usidstring

The unique shopper ID.

channel_idstringrequired

The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.

code_challengestring

PKCE code verifier. Created by the client calling the `login` endpoint. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_challenge` is optional when using a private client id for the token request.

json
{
  "redirect_uri": "http://localhost:3000/callback",
  "channel_id": "RefArch",
  "client_id": "z99ec276-cg53-4g94-cf72-76f300c6778zc",
  "response_type": null,
  "state": "client-state",
  "scope": "openid|offline_access|email",
  "usid": "18cda486-fe32-4e27-888b-6e4f89938e67",
  "code_challenge": "krc5G3_5lRUcXDUzFZQ88oJA_-ZmlHWkyGsgOrSLEWg"
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.

Authenticate Customer — Salesforce Commerce Cloud — Documentation