> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User authentication with reCAPTCHA

This authentication use case includes the optional reCAPTCHA service with the Authenticate User Process.

reCAPTCHA is a service provided by Google, and is integrated into a website through JavaScript code provided by Google themselves. When the client provides a verification token in the request, Storefront Gateway then independently validates the token through back-channel requests to Storefront Gateway's reCAPTCHA API.

<img src="https://mintcdn.com/amdocs-spbu/0TZ9XF1Mst_2ATcV/marketONE/sgProcessGuide/images/sfgw_umlAuthNrecaptcha.png?fit=max&auto=format&n=0TZ9XF1Mst_2ATcV&q=85&s=8928fae6c8786fef0e5c3805b955ba88" alt="" width="1366" height="1028" data-path="marketONE/sgProcessGuide/images/sfgw_umlAuthNrecaptcha.png" />

## Request

The client calls the Session Start API to initialize the Process, and includes the reCAPTCHA token alongside the end user's credentials:

```
**REQUEST - POST https://\{your.url\}/session/start**
{
   "authnIdentifier": "jane.smith@example.ca",
   "credential": "5oodP@s$word321",
   "recaptchaResponse": "reCAPTCHA response token value here"
}
```

| `authnIdentifier` | The end user's registered email address, mobile number, or alias (if any) |
| - | - |
| `credential` | The end user's password |
| `recaptchaResponse` | The verification token provided by reCAPTCHA either after a challenge has been completed, or reCAPTCHA has implicitly verified the user as human (without any challenge required). Storefront Gateway will use this token to independently verify with Google that reCAPTCHA has been successfully completed during the login process. |

## Process Complete

If the user provides valid credentials, and no other authentication protocols are necessary (e.g., MFA) then the Process responds with an `HTTP 200` status code, and User details in the response body:

```
**RESPONSE - body**
{
   "processId": "eec918ff-5db4-4fee-a601-5ff76a099c8e",
   "lastStep": true,
   "runtimeId": 229,
   "userId": 12345,
   "userAuthenticated:" true
}
```

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `runtimeId` | Identifier of the Storefront Gateway Runtime entity currently associated to the Storefront Gateway User entity.\*\*About Runtime Entities:\*\*Upon user creation or authentication, Storefront Gateway looks for a JRUNTIMEID cookie in the end user's browser or application. If no cookie is found, Storefront Gateway creates a Runtime Entity with a unique ID and associates it to the user during the login phase. Storefront Gateway will generate and pass a corresponding JRUNTIMEID cookie for clients to store and return with subsequent requests. |
| `userId` | The unique identifier of the current user. |
| `userAuthenticated` | Boolean that indicates if the user was authenticated into Storefront Gateway. |
| The client application can retain the User and Runtime entity IDs to use Storefront Gateway APIs to perform CRUD operations against those (and other associated) entities. | |

**Parent topic:**[Authenticate User Process](c_authenticateUser)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.