PHP, Python, .NET, Node.js
Follow this guide if your pages are rendered on the server, in PHP, Python, .NET or Node.js. At the end your users sign in with Block-Auth and your backend has a verified session for them.
What you'll build
Everything happens in your backend. You don't install anything from Block-Auth in the browser: your pages only need a normal link to sign in and a form to sign out.
Your backend sends the user to the Block-Auth login and receives them back on a callback with a one-time code. It redeems the code with your API secret, gets the user from Block-Auth and creates its own session.
- 1Your pages → Your backendGET /blockauth/login
- 2Your backend → Block-AuthPOST /api/auth/authorize
- 3Your backend → Your pagesRedirect to the login
- 4Your pages → Block-AuthThe user signs in
- 5Block-Auth → Your pagesBack with ?code&state
- 6Your pages → Your backendGET /blockauth/callback
- 7Your backend → Block-AuthPOST /api/auth/token
- 8Block-Auth → Your backend{ address, roles }
- 9Your backend → Your pagesSession cookie and redirect
Your pages
A plain link
Your backend
Block-Auth SDK
Block-Auth
Hosted by Block-Auth
- 1GET /blockauth/login
- 2POST /api/auth/authorize
- 3Redirect to the login
- 4The user signs in
- 5Back with ?code&state
- 6GET /blockauth/callback
- 7POST /api/auth/token
- 8{ address, roles }
- 9Session cookie and redirect
If your frontend is a React, Vue or Angular app, follow the React, Vue or Angular guide instead: it adds the sign-in button with the widget.
Prepare your app
- In the Dashboard, create your application following the Integration Quickstart. As the domain, enter the host your users see (for example
your-app.com). - You set up the keys and the
.envat the start of the first step, Install the client.

