-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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. |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
<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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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. |
<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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
In the Arcade Dashboard, pick the **Custom verifier** option and add the URL of your verifier route. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Add screenshot soon
Co-authored-by: Evan Tahler <[email protected]>
…g-oauth-sec-docs' into nate/customer-facing-oauth-sec-docs
Add a doc explaining how to configure session verification for production.