Skip to content

Add secure/brand auth in production doc #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nbarbettini
Copy link
Collaborator

Add a doc explaining how to configure session verification for production.

Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2025 4:43am

Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only blocking thing would be to pre-make the github discussion and get that URL in here


# Secure and Brand the Auth Flow in Production

To keep your users safe, Arcade.dev performs a session verification check when a tool is authorized for the first time. This check verifies that the user who is authorizing the tool is the same user who started the authorization flow, which helps prevent phishing attacks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a session verification check

I like that phrasing a lot!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evantahler When I was building the UI, I ended up calling it "user verification" instead of "session verification". I think it's less jargony, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neutral - either way is good with me. But be consistent!

Comment on lines 23 to 29
<Note>
Arcade's default OAuth apps can *only* be used with the Arcade session verifier.
If you are building a multi-user production app, you must obtain your own OAuth app credentials and add them to Arcade.
For example, [configure Google auth in the Arcade Dashboard](https://docs.arcade.dev/home/auth-providers/google#access-the-arcade-dashboard).
</Note>

The Arcade.dev session verifier helps keep your auth flows secure while you are building and testing your agent or app. When you're ready to share your work with others, implement a [custom session verifier](#set-up-a-custom-session-verifier) so your users don't need to sign in to Arcade.dev.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch the order of these 2 paragraphs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <Note> para and this para?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like the explanation of the session verifier to come first


## Set up a custom session verifier

In a production application or agent, user sessions are verified by your code, not Arcade.dev. To enable this, build a custom verifier route and add the URL to the Arcade Dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In a production application or agent, user sessions are verified by your code, not Arcade.dev. To enable this, build a custom verifier route and add the URL to the Arcade Dashboard.
In a production application or agent, user sessions are verified by your code, not Arcade.dev. This allows you to fully control your end-user's experience and authentication. To enable this, build a custom verifier route and add the URL to the Arcade Dashboard.


When your users authorize a tool, Arcade.dev will redirect the user's browser to your verifier route with some information in the query string. Your custom verifier route must send a response back to Arcade.dev to confirm the user's session details.

If you need help, start a [GitHub discussion](https://github.com/ArcadeAI/arcade-ai/discussions) and we'll be happy to assist.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-start the discussion now, and link that URL. One federated discussion is better so folks and help each other

The route must gather the following information:

- The `flow_id` from the current URL's query string
- The unique ID of the user currently signed in. This varies depending on how your app is built, but it is typically retrieved from a session cookie or other secure storage. It **must** match the user ID that your code specified at the start of the authorization flow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The unique ID of the user currently signed in. This varies depending on how your app is built, but it is typically retrieved from a session cookie or other secure storage. It **must** match the user ID that your code specified at the start of the authorization flow.
- The unique ID of the user currently signed in. This varies depending on how your app is built, but it is typically retrieved from a session cookie or other secure storage. It **must** match the user ID that your code specified at the start of the authorization flow. User IDs are commonly an ID from your application, email address, or similar.

Comment on lines +62 to +75
<Tabs items={["REST"]} storageKey="preferredLanguage">
<Tabs.Tab>
```text
POST https://cloud.arcade.dev/api/v1/oauth/confirm_user
Authorization: Bearer <arcade_api_key>
Content-Type: application/json

{
"flow_id": "<flow_id from the query string>",
"user_id": "<the current user's ID>"
}
```
</Tabs.Tab>
</Tabs>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will get this into the client libs soon, yes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, next on my list. That will result in more tabs here

Comment on lines +120 to +121
In the Arcade Dashboard, pick the **Custom verifier** option and add the URL of your verifier route.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add screenshot soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants