Quickstart

Get a full BrownieGate login flow running in minutes.

Never expose your API key or encryption key in client-side code. Keep them server-only.

1. Create a project

  1. Go to the BrownieGate dashboard
  2. Create a new project
  3. Set your callback URL (e.g. https://yourapp.com/auth/callback)
  4. Copy the following values:
    • Project UUID
    • API key
    • Encryption key

2. Add a “Login with BrownieGate” button

Redirect the user to the BrownieGate authentication endpoint from your frontend:

        
<a href="https://browniegate.com/auth?project_uuid=PROJECT_UUID">
  Login with BrownieGate
</a>
      

After authentication, the user will be redirected back to your callback URL with an encrypted payload.

3. Handle the callback (server-side)

Your callback endpoint receives an encrypted payload containing a one-time code and timestamp.


{
  "payload": "ENCRYPTED_STRING"
}
      

Decrypt it using your project's encryption key.

4. Verify the login

Send the one-time code to BrownieGate for verification (server-to-server):

On success, BrownieGate returns the authenticated user_id.

5. Fetch user data (optional)

Retrieve user information the user has consented to:

Only fields enabled in your project's services configuration will be returned.

6. Create a session

After verification, establish a session in your app:

Your user is now logged in 🎉

Next steps