# Authentication

When a user wants to log into an application, they will provide their Hive username.

![](https://1669603073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFAr86K7oT03KsmxlrwVj%2Fuploads%2FQnK8AJvtn4R3UtG5zqJ0%2FHiveAuth-App-1-SignIn-small.png?alt=media\&token=1a383209-cb9d-4963-9929-b11a7fd060fa)

When the user hits the sign-in button, the **App** will send an authentication request to the **HAS** and ask the user to start their favorite Private Key Storage Application (**PKSA**), typically their favorite wallet application installed on their mobile (Hive Keychain for Mobile for example)

![](https://1669603073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFAr86K7oT03KsmxlrwVj%2Fuploads%2FNnnWwh7Zc7SJw7tuj2kj%2FHiveAuth-App-2-Scan-small.png?alt=media\&token=5e0af3a4-feb7-4afa-9969-b485f0fca05f)

The user then opens their wallet and scans the QR code. Alternatively, if the application that the user wants to sign into is a mobile app, the latest can use deep linking and trigger the mobile device to install a wallet app or open it if already installed.

If the wallet stores the keys of the account that wants to log in, it will request approval or denial of the user's authentication request.

&#x20;

![Wallet approval mockup](https://1669603073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFAr86K7oT03KsmxlrwVj%2Fuploads%2FXtRlNejFhCbi5L03nBIB%2FScreenshot_2023-12-21-12-41-37-105_com.hiveauth.mobile.jpg?alt=media\&token=7ce51ece-1196-4222-9094-90e40e35124d)

If the user approve*s* the authentication request, the **APP** will be informed by the **HAS** that the user has successfully authenticated and that it can proceed with the user sign-in.

The **APP** has 100% certainty that the account exists and that whoever signs in owns the account's private keys.

Likewise, the user has explicitly identified and approved the application for further interaction.

At this moment, the application session and the users are now registered with the **HAS** and can communicate with each other through a secure encrypted channel.


---

# 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://docs.hiveauth.com/introduction/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.
