> For the complete documentation index, see [llms.txt](https://appmaster.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://appmaster.gitbook.io/docs/modules/module/authentication/auth.md).

# Auth

Built-in authentication and authorization module.

**Auth** module provides authentication and authorization for your application, including user management, group management, user registration, login, and related functions. It is installed automatically when the project is created. By default, the module's middleware is attached to every endpoint and grants access to any user group. Detailed access controls can be configured by adjusting the middleware settings in every endpoint.

{% hint style="info" %}
**Default User Login & Password**

Login: <admin@appmaster.io>\
Password: appmaster
{% endhint %}

## Data models

* User
* User Session

{% content-ref url="/pages/-MiF\_7i3hhAwOKMU1pyK" %}
[Data Model User](/docs/data-design/auto-generation-of-data-models/list-of-generated-models/data-model-user.md)
{% endcontent-ref %}

{% content-ref url="/pages/iSl5azZa4zztZSqdWi5G" %}
[Data Model User Session](/docs/data-design/auto-generation-of-data-models/list-of-generated-models/data-model-user-session.md)
{% endcontent-ref %}

## Business processes

* [Authentication](/docs/business-logic/block/business-process-blocks/authentication.md)
* [Authorization](/docs/business-logic/block/business-process-blocks/authorization.md)
* [Logout](/docs/business-logic/block/business-process-blocks/logout.md)
* [Get Current User](/docs/business-logic/block/business-process-blocks/get-current-user.md)
* [Registration](/docs/business-logic/block/business-process-blocks/registration.md)
* [Add User to Group](/docs/business-logic/block/business-process-blocks/add-user-to-group.md)
* [Remove User from Group](/docs/business-logic/block/business-process-blocks/remove-user-from-group.md)
* [Chan](/docs/business-logic/block/business-process-blocks/change-password.md)[ge Password](/docs/business-logic/block/business-process-blocks/change-password.md)
* [Restore Password](/docs/business-logic/block/business-process-blocks/restore-password.md)
* [Generate Auth Token](/docs/business-logic/block/business-process-blocks/generate-auth-token.md)
* [Hash Password](/docs/business-logic/block/business-process-blocks/hash-password.md)
* [Probe Password](/docs/business-logic/block/business-process-blocks/probe-password.md)&#x20;

{% content-ref url="/pages/-MiF\_VRdhRkTz21sVAWk" %}
[Group Auth](/docs/business-logic/block/business-process-blocks.md)
{% endcontent-ref %}

## Endpoints

* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxXdvjIpBbm50Z-Hf%2Fimage.png?alt=media&amp;token=12722665-5fc8-420b-9fa0-423a005ea3fa" alt="" data-size="original"> */logout/  - the current user exits the application.*
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxXdvjIpBbm50Z-Hf%2Fimage.png?alt=media&amp;token=12722665-5fc8-420b-9fa0-423a005ea3fa" alt="" data-size="original"> */auth/ - user authentication with login and password.*
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxXdvjIpBbm50Z-Hf%2Fimage.png?alt=media&amp;token=12722665-5fc8-420b-9fa0-423a005ea3fa" alt="" data-size="original"> */register/ - registration of a new user.*&#x20;
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxlmA1oEojrIm9D3P%2Fimage.png?alt=media&amp;token=b03785be-de15-4d46-82b7-eebcb456e516" alt="" data-size="original"> */confirm/ - confirmation of registration of a new user.*&#x20;
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxteOL80251BXcPdM%2Fimage.png?alt=media&amp;token=189dae8c-007f-4055-b422-d8cfdad24385" alt="" data-size="original"> */user/change-password/ - change the user's password.*&#x20;
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxteOL80251BXcPdM%2Fimage.png?alt=media&amp;token=189dae8c-007f-4055-b422-d8cfdad24385" alt="" data-size="original"> */user/restore-password/ - reset the user's password.*&#x20;
* <img src="https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgtwfVtBsaWwqHe5SGJ%2F-MgtxlmA1oEojrIm9D3P%2Fimage.png?alt=media&amp;token=b03785be-de15-4d46-82b7-eebcb456e516" alt="" data-size="original"> */user/profile/ - getting the profile of the current user.*

## Middleware

* [Token Auth](https://docs.appmaster.io/v/russian/modules-and-integrations/spisok-modulei/authentication-modules/users-and-groups/middleware-token-auth)

{% content-ref url="/pages/-MiF\_DFbbChi0n2Ykznr" %}
[Middleware: Token Auth](/docs/endpoints/middleware/middleware-token-auth.md)
{% endcontent-ref %}

## UI компоненты

### Web application&#x20;

* Login Form&#x20;
* Signup Form&#x20;

### Mobile app&#x20;

* Sign In Screen&#x20;
* Sign Up Screen

## Settings

| Setting                                                                                                                                                                                                                                                                                                                                              | Default Value | Description                                                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Signup                                                                                                                                                                                                                                                                                                                                               | On            | Allows users to independently create accounts (register) in your application. This setting is enabled by default. If you want to only manually register users, turn off this setting. |
| Signup Groups                                                                                                                                                                                                                                                                                                                                        | Users         | List of user groups to which the user will be automatically added after registration.                                                                                                 |
| Session Timeout                                                                                                                                                                                                                                                                                                                                      | 60 min.       | How long the user's session will be active if they do not perform any actions in the application. After the timeout expires, the user will have to log in again.                      |
| Signed-up User Active                                                                                                                                                                                                                                                                                                                                | On            | State of new users after registration. By default, all users become active after registration. If you want to activate each account manually, turn off this setting.                  |
| Failed login delay (in ms)                                                                                                                                                                                                                                                                                                                           | 0             | Setting of delay time for retry of failed login request to prevent bruteforce. By default, the delay is disabled (set to 0).                                                          |
| Groups Tab                                                                                                                                                                                                                                                                                                                                           | Admins, Users | <p>                                                                                                                                                                                   |
| Defines what user groups your application will have. You can add new groups to configure user privileges granularly across the application.</p><p></p><p><span data-gb-custom-inline data-tag="emoji" data-code="2757">❗</span> Remove user groups with extreme caution because some business processes and components may be dependent on them.</p> |               |                                                                                                                                                                                       |
