You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
signUserIn
Initialize an authenticated user session in SAP Commerce Cloud.
It retrieves an access token from the of the SAP OAuth server. The token is saved in the request as the vsf-sap-token cookie automatically using the Set-Cookie response header. The default options of the cookie can be modified through the property in middleware.config.js.
Signature
export declare function signUserIn(
context: SapccIntegrationContext,
props: OAuthUserAuthenticationProps
): Promise<OAuthUserTokenResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | OAuthUserAuthenticationProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns a representation of an OAuthUserTokenResponse.
Referenced Types
Examples
Signing a user in.
import { sdk } from '~/sdk';
const tokenResponse = await sdk.commerce.signUserIn({
username: 'test@gmail.com',
password: 'test123!'
});