---
title: "Block-Auth Documentation"
description: "Passwordless login for your app with a decentralized identity. Your backend gets a verified user and keeps its own session."
url: "/"
language: "en"
---

# Block-Auth

Block-Auth lets people sign in to your app without passwords, with a decentralized identity they control. Your backend gets a verified user from Block-Auth and keeps its own session, its own users and its own rules.

## How it works

1. **The user signs in on Block-Auth.** Your app opens the Block-Auth login at `auth.block-auth.io`, in a popup or with a redirect. The user signs in with their Block-Auth identity, from the browser extension or the mobile app, or with Google, Microsoft, MetaMask, Phantom or WalletConnect, and approves the session.
2. **Your backend gets the user.** Block-Auth hands back a one-time code. Your backend redeems it with your API secret at `POST /api/auth/token` and receives the user's address and roles. The browser never decides who the user is.
3. **Your app keeps its session.** Your backend creates its own session, as with any other login method, and can link the Block-Auth user to a user you already have.

Every session is signed on Block-Auth's blockchain, and your users can see and close their sessions, devices and linked apps in Block-Auth Identity.

## Explore the architecture

Pick your stack to see the pieces you use in your code and how they connect to Block-Auth. Hover over a piece or a step to follow it.

The two login flows, step by step. On the website this is an interactive diagram.

**React, Vue, Angular (+ backend), widget in a popup:**

1. Your frontend → Block-Auth: Login in a popup (PKCE)
2. Block-Auth → Your frontend: One-time code
3. Your frontend → Your backend: `POST /code`
4. Your backend → Block-Auth: `POST /api/auth/token`
5. Block-Auth → Your backend: `{ address, roles }`
6. Your backend → Your frontend: httpOnly session cookie
7. Your frontend → Your backend: `GET /me`
8. Your backend → Your frontend: `{ address, roles }`

**PHP, Python, .NET, Node.js, and WordPress (redirect login):**

1. Your pages → Your backend: `GET /blockauth/login`
2. Your backend → Block-Auth: `POST /api/auth/authorize`
3. Your backend → Your pages: Redirect to the login
4. Your pages → Block-Auth: The user signs in
5. Block-Auth → Your pages: Back with ?code\&state
6. Your pages → Your backend: `GET /blockauth/callback`
7. Your backend → Block-Auth: `POST /api/auth/token`
8. Block-Auth → Your backend: `{ address, roles }`
9. Your backend → Your pages: Session cookie and redirect

## What you get

- **Passwordless login** with social accounts, wallets and the Block-Auth extension, on a login page Block-Auth hosts and maintains.
- **Account linking** between a Block-Auth identity and the users you already have, without sharing your database.
- **Roles** you define in the Dashboard, returned with every login.
- **Signed webhooks** when a user signs out (`signout`) or unlinks your app (`account.unlinked`).
- **SDKs** for React, Vue and Angular, for PHP, Python and .NET, and a WordPress plugin.
