https://linen.dev logo
How to pass specific tools/scopes when initiating ...
# 🖥│support-forum
h
Hi! I'm using connected_accounts.initiate() with a custom auth config for Gmail. My auth config has all Gmail scopes, but for some users I only need read access (e.g. GMAIL_GET_EMAIL). Is there a way to pass specific tools or scopes at connection initiation time so the OAuth consent screen only asks for what's needed? I see tools_for_connected_account_creation on auth configs but that applies globally — I need it per connection. What's the recommended approach here? Thanks!
u
Hey @halo, currently we do not support specifying scope at connection initiation and it has to be done at authConfig level. Let me know if you need anything.
h
so my use case if based on use case user selects which tools it has to use and based on that when connecting gmail lets say, it should ask for right scopes based on tooosl
u
Hey @halo, I can recommend an approach: Try fetching tool using [this](https://docs.composio.dev/reference/api-reference/tools/getTools) endpoint. In the response payload, look for
scopes
array, it should help you get scopes based on tools. Also, do checkout our chatbot in docs or platform, it should be super helpful!
h
so i get scope against each tool, now while authenticating user I know which tools he is going to use so I know which scopes should be asked, but then how to pass it to composio so that correct one gets displayed on Gmail auth connection page ? Only solution I can think is creating mutliple auth configs with different combincation of scopes and then sending right auth config while connection, is this the only soultion or is there more cleaner one
u
Yes, I'd recommend updating the authConfig prior to each connection or Alternatively, use different authConfigs.