> For the complete documentation index, see [llms.txt](https://dev.hybrid-chain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.hybrid-chain.com/api-docs/core-functionality/authentication/auth-user-login.md).

# AUTH: User Login

As described in the "AUTH: Get Seed" Endpoint, before the login credentials can be passed to the backend, the seed must be requested using the appropriate parameters.

**Use the Unique User Identifier ('email' or 'msisdn' parameter) to correctly link the user profile.**

Before submitting the password data in this request, it must first be SHA256-hashed as follows:

```
var hashed_password = SHA256(password + seed);
```

\* the HASHED\_PASSWORD must then be hashed *again* with the random\_key from the "Get Seed" Request:

```
var randomized_password = SHA256(hashed_password + random_key );
```

Now the randomized password is ready to be submitted.

{% hint style="success" %}
For verification and as an example, the clear-text password "starwars" results into "2b563e6b0e91b9795bb1cd49ba3486a0cbf1311ee1d12c4c2b4cb67067069ae3" when using the seed ("ZDlmbFI2VkNjT01nNk1xdXhoZk1QV1dS") and the random key ("WlpoUWhtMjNvY2toRXlYVlBVenBXeHVr") correctly.
{% endhint %}

{% hint style="info" %}
Please see the "Register User Endpoint" for a Linux Console example
{% endhint %}

{% hint style="warning" %}
**Ultimately, the returned bearer token is to be used in the header of every request that requires authentication.**
{% endhint %}

## AUTH: Log a User in

> As described in the "AUTH: Get Seed" Endpoint, before the login credentials can be passed to the backend, the seed must be requested using the appropriate parameters.\
> \
> \*\*Use the Unique User Identifier ('email' or 'msisdn' parameter) to correctly link the user profile.\*\*\
> \
> Before submitting the password data in this request, it must first be SHA256-hashed as follows:\
> \
> \\\* var hashed\_password = SHA256(password + seed);  \
> \\\* the HASHED\_PASSWORD must then be hashed \_again\_ with the random\_key from the "Get Seed" Request:  \
> \\\* var randomized\_password = SHA256(hashed\_password + random\_key );\
> \
> Now the randomized password is ready to be submitted.\
> \
> For verification and as an example, the clear-text password "starwars" results into "2b563e6b0e91b9795bb1cd49ba3486a0cbf1311ee1d12c4c2b4cb67067069ae3" when using the seed ("ZDlmbFI2VkNjT01nNk1xdXhoZk1QV1dS") and the random key ("WlpoUWhtMjNvY2toRXlYVlBVenBXeHVr") correctly.\
> \
> (Please see the "Register User Endpoint" for a Linux Console example)\
> \
> \*\*Ultimately, the returned bearer token is to be used in the header of every request that requires authentication.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Hybrid-Chain API Documentation and Specification","version":"1.0.0"},"servers":[{"url":"https://api.hybrid-chain.com/api/v1"}],"paths":{"/auth/login":{"post":{"tags":["Authentication"],"summary":"AUTH: Log a User in","description":"As described in the \"AUTH: Get Seed\" Endpoint, before the login credentials can be passed to the backend, the seed must be requested using the appropriate parameters.\n\n**Use the Unique User Identifier ('email' or 'msisdn' parameter) to correctly link the user profile.**\n\nBefore submitting the password data in this request, it must first be SHA256-hashed as follows:\n\n\\* var hashed_password = SHA256(password + seed);  \n\\* the HASHED_PASSWORD must then be hashed _again_ with the random_key from the \"Get Seed\" Request:  \n\\* var randomized_password = SHA256(hashed_password + random_key );\n\nNow the randomized password is ready to be submitted.\n\nFor verification and as an example, the clear-text password \"starwars\" results into \"2b563e6b0e91b9795bb1cd49ba3486a0cbf1311ee1d12c4c2b4cb67067069ae3\" when using the seed (\"ZDlmbFI2VkNjT01nNk1xdXhoZk1QV1dS\") and the random key (\"WlpoUWhtMjNvY2toRXlYVlBVenBXeHVr\") correctly.\n\n(Please see the \"Register User Endpoint\" for a Linux Console example)\n\n**Ultimately, the returned bearer token is to be used in the header of every request that requires authentication.**","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Cache-Control":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"keep-alive":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Date":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"BAD REQUEST","headers":{"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Cache-Control":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"keep-alive":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Date":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://dev.hybrid-chain.com/api-docs/core-functionality/authentication/auth-user-login.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
