# Accounts and security

Source: https://docs.anetos.dev/main/guides/accounts-and-security/

- [Add accounts with make:auth](https://docs.anetos.dev/main/guides/accounts/index.md): Give your app user accounts in one command: registration, login with "remember me" and throttling, login with Google and GitHub, two-factor authentication, account settings, logout, email verification, password reset and API tokens, with their pages, emails, routes, migration and tests. The code is written into your app, where you change it as you like; the parts that must be right (password hashing, tokens, sessions, throttling, the OAuth flow) stay in the [`auth`](https://docs.anetos.dev/main/guides/authentication/index.md) and [`social`](https://docs.anetos.dev/main/guides/social-login/index.md) packages, so fixes reach you with `go get -u`.
- [Add accounts to an API](https://docs.anetos.dev/main/guides/api-accounts/index.md): In a project made with `anetos new --stack=api`, `make:auth` writes accounts that log in with API tokens: registration, login (with two-factor codes for users who turn them on), logout, email verification, password reset and change, and token management, as JSON endpoints under `/api/v1`. A client keeps its token and sends it in every request; the app's own single-page app can log in with a session cookie instead ([Log in from your SPA with a session cookie](https://docs.anetos.dev/main/guides/spa-login/index.md)).
- [Authentication](https://docs.anetos.dev/main/guides/authentication/index.md): Let people register, log in (with "remember me"), log out, verify their email address and reset a forgotten password, and give API clients tokens. The complete app is [`examples/auth`](https://github.com/anetos-dev/anetos/tree/main/examples/auth). In an `anetos new` project, `go tool anetos make:auth` writes all of this into your app: see [Add accounts with make:auth](https://docs.anetos.dev/main/guides/accounts/index.md). This guide is the `auth` package underneath, step by step.
- [Social login](https://docs.anetos.dev/main/guides/social-login/index.md): Let users log in with Google, GitHub, or any OpenID Connect provider (Okta, Auth0, Microsoft Entra ID, Keycloak, GitLab…). The complete app is [`examples/auth`](https://github.com/anetos-dev/anetos/tree/main/examples/auth).
- [Two-factor authentication and password confirmation](https://docs.anetos.dev/main/guides/two-factor/index.md): Ask for more than a password: a code from an authenticator app (Google Authenticator, 1Password, Authy… : TOTP, RFC 6238) after it, with recovery codes for a lost phone; and the password again before sensitive pages. Package `auth` does the parts that must be right (secrets encrypted, codes used once, throttling); your handlers and pages call it. The complete app is [`examples/auth`](https://github.com/anetos-dev/anetos/tree/main/examples/auth).
- [Authorization](https://docs.anetos.dev/main/guides/authorization/index.md): Decide what a logged-in user may do, with policies the compiler checks.
- [Roles and permissions](https://docs.anetos.dev/main/guides/roles-and-permissions/index.md): Give users roles, globally or in a team, and check what they may do, with package `auth/rbac`.
- [Rate limiting](https://docs.anetos.dev/main/guides/rate-limiting/index.md): Limit how often clients can call your routes, and how often they can attempt actions such as logging in.
- [Keep an audit log](https://docs.anetos.dev/main/guides/audit-log/index.md): Record who created, changed, deleted and restored the rows of your models, field by field, with package `audit`: for data governance, for support, and for "who changed this?".
- [Add an admin panel](https://docs.anetos.dev/main/guides/admin/index.md): Give your staff pages to list, search, filter, create, edit and delete the app's records, and to manage users and roles, with the admin interface of module `anetos.dev/anetos/admin`: no front-end build, permissions from [roles](https://docs.anetos.dev/main/guides/roles-and-permissions/index.md), and every change in the [audit log](https://docs.anetos.dev/main/guides/audit-log/index.md) for the models it tracks.
