# Authentication

Authentication, registration, and password flows

## Complete Google login with an access token

> Exchanges a Google OAuth access token for an OmniShop user session.\
> \
> \*\*Process\*\*\
> \- Validates the token via Google token-info endpoint\
> \- Confirms token audience matches configured client IDs\
> \- Fetches user info and completes social login\
> \
> \*\*Redirects\*\*\
> \- Success: redirects to the basket or provided \`next\` parameter\
> \- Failure: returns HTTP 400

```json
{"openapi":"3.1.0","info":{"title":"Users API - Public Endpoints","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Authentication, registration, and password flows"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/google/login/token/":{"post":{"tags":["Authentication"],"operationId":"loginWithGoogleToken","summary":"Complete Google login with an access token","description":"Exchanges a Google OAuth access token for an OmniShop user session.\n\n**Process**\n- Validates the token via Google token-info endpoint\n- Confirms token audience matches configured client IDs\n- Fetches user info and completes social login\n\n**Redirects**\n- Success: redirects to the basket or provided `next` parameter\n- Failure: returns HTTP 400","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginTokenRequest"}}}},"responses":{"302":{"description":"Login succeeded, user redirected","headers":{"Location":{"schema":{"type":"string"},"description":"Destination URL (defaults to `/baskets/basket/`)"}}},"400":{"description":"Token invalid or Google verification failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"GoogleLoginTokenRequest":{"type":"object","description":"JSON payload forwarded to Google token verifier","required":["access_token"],"properties":{"access_token":{"type":"string","description":"OAuth access token issued by Google"}}},"ErrorResponse":{"type":"object","description":"Generic error payload","required":["detail"],"properties":{"detail":{"type":"string"},"code":{"type":"string"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/users/module-1/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
