auth icon indicating copy to clipboard operation
auth copied to clipboard

Return oauth_secret_token for OAuth1.0 providers

Open kangmingtay opened this issue 4 years ago • 19 comments
trafficstars

Feature request

Currently, only the provider_token (oauth_token) is being returned for OAuth1.0 providers. In the future, we would either want to return the oauth_secret_token as well or not at all.

Is your feature request related to a problem? Please describe.

Returning both the provider_token and oauth_secret_token will allow the service to retrieve a user's credentials in the future without having to ask the user for permission again. In the case of Twitter, the service can retrieve a user's tweets / retweet count / etc...

Describe the solution you'd like

OAuth1.0 tokens generally have a longer lasting lifetime compared to OAuth2.0 (Twitter's tokens do not expire but can be revoked by the user whenever). We can send the oauth_secret_token as part of the query parameters returned together with the provider_token.

Additional context

  1. Is it secure / a good practice to send the oauth_secret_token as a query parameter?

kangmingtay avatar May 24 '21 14:05 kangmingtay

+1 for this one! If it works out it would be helpful for me! I have a twitter app that makes use of secret on user's behalf!

If it's not a priority right then please let me know, thanks!

rishimohan avatar Jul 09 '21 22:07 rishimohan

@kangmingtay Hi Kang, any ETA/plans for this one? I've been facing auth issues in my existing setup and would really want to use Supabase before I get too many users in the app(it's already on production 😅)

rishimohan avatar Aug 03 '21 16:08 rishimohan

@kangmingtay @kiwicopple Can we get an update on this one? The provider_token on it's own is not too helpful for Twitter.

mike-wax avatar Sep 22 '21 14:09 mike-wax

Hey @rishimohan, @mike-wax, we're currently in the midst of refactoring gotrue so that we can securely return the provider_token & provider_secret token (for twitter's case). We didn't support it initially because the supabase-js client library stores tokens in local storage. This is a security concern for twitter as twitter uses oauth1.0 - which returns tokens that are long-lived. If an attacker manages to get the tokens from local storage, the tokens do not expire and only the user can revoke them.

kangmingtay avatar Sep 23 '21 03:09 kangmingtay

@kangmingtay thanks! Are you planning to store the secrets in supabase encrypted?

mike-wax avatar Sep 23 '21 09:09 mike-wax

@kangmingtay Makes sense, looking forward to it!

rishimohan avatar Sep 23 '21 10:09 rishimohan

@kangmingtay thanks! Are you planning to store the secrets in supabase encrypted?

Nope, for oauth1.0 (twitter), we don't intend to store it on the browser at all. We'll be returning the provider_token & provider_secret_token in the api response. For oauth2.0, the provider_token will be returned the same way as mentioned above and the provider_refresh_token will be stored as a http-only cookie. We'll be providing an endpoint to refresh your provider_token as well.

kangmingtay avatar Sep 23 '21 10:09 kangmingtay

Any update?

Timonzimm avatar Jan 29 '22 21:01 Timonzimm

Given that this was implemented in #490, I'm closing the issue. Feel free to re-open it.

hf avatar Sep 29 '22 14:09 hf

@hf can you please share link to the PR where it's implemented? thanks

rishimohan avatar Sep 29 '22 15:09 rishimohan

@rishimohan I'll reopen the issue as this was only added to OAuth2.0 providers, while Twitter uses OAuth1.0.

hf avatar Sep 30 '22 08:09 hf

@kangmingtay any update? This is quite a blocking issue.

Timonzimm avatar Oct 13 '22 08:10 Timonzimm

Months have passed, yet an update to be made...

diogoribeirodev avatar Nov 17 '22 00:11 diogoribeirodev

+1 would love an update on this!

feresr avatar Nov 18 '23 03:11 feresr

Return oauth_secret_token for OAuth1.0 providers

Will this be implemented?

Otherwise will look at different solutions.

Thank you.

operatorultra avatar Dec 17 '23 22:12 operatorultra

+1

jetlej avatar Jan 01 '24 20:01 jetlej

pls

Mumbo-Jumbo-3 avatar Sep 04 '24 21:09 Mumbo-Jumbo-3