Skip to content

Commit 28df959

Browse files
authored
Add a FAQ (#440)
1 parent 64dc299 commit 28df959

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

pages/home/faq.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,49 @@ if (auth_response.status !== "completed") {
103103
</Tabs.Tab>
104104
</Tabs>
105105
106+
### Can I use broader OAuth scopes than what a tool requires?
107+
108+
Yes! If you need broader permissions than what a tool defines as its minimum requirement, you can request additional scopes during authentication.
109+
110+
For example, the `GoogleDrive.SearchFiles` tool requires the `/auth/drive.file` scope (which only searches files created by your app or selected via file picker), but if you have approval for the broader `/auth/drive` scope, you can authenticate with both scopes to search all files on Google Drive.
111+
112+
The tool will work with the broader permissions while still satisfying its minimum scope requirement. Here's how to authenticate with multiple scopes:
113+
114+
<Tabs items={["Python", "JavaScript"]} storageKey="preferredLanguage">
115+
<Tabs.Tab>
116+
```python
117+
from arcadepy import Arcade
118+
119+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
120+
user_id = "{arcade_user_id}"
121+
122+
auth_response = client.auth.start(
123+
user_id=user_id,
124+
provider="google",
125+
scopes=[
126+
"https://www.googleapis.com/auth/drive.file",
127+
"https://www.googleapis.com/auth/drive"
128+
]
129+
)
130+
```
131+
</Tabs.Tab>
132+
<Tabs.Tab>
133+
```javascript
134+
import Arcade from "@arcadeai/arcadejs";
135+
136+
const client = new Arcade();
137+
const user_id = "{arcade_user_id}";
138+
139+
const authResponse = await client.auth.start(user_id, "google", {
140+
scopes: ["https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive"]
141+
});
142+
```
143+
</Tabs.Tab>
144+
</Tabs>
145+
146+
After authentication, call `GoogleDrive.SearchFiles` as usual and it will be able to search all files using the broader token permissions.
147+
148+
106149
## Your question is not here?
107150
108151
Please go to the discussions page on GitHub. Someone else may have asked something similar already. If not, please start a new discussion and we'll get to it as soon as possible.

0 commit comments

Comments
 (0)