simov / grant

OAuth Proxy
MIT License
4.08k stars 257 forks source link

Add support for Twitter OAuth1a "x_auth_access_type" #272

Closed chez14 closed 2 years ago

chez14 commented 2 years ago

Documentation Reference: https://developer.twitter.com/en/docs/authentication/api-reference/request_token

Based on the documentation, we can customize the login scope of the app. The scope definition must be provided when requesting token via x_auth_access_type.

Reviewing the grant's OAuth1 flow code, we can either use providers.scope, or we can add providers.custom-param.x_auth_access_type to fill the x_auth_access_type param.

Thank you.

simov commented 2 years ago

Hi, I pushed it here https://github.com/simov/grant/commit/c6b76b78e3ee36358c74ee7bc2155dac945d3a97 but I need to add some tests for it.

In the meantime you can reference it as github:simov/grant in your package.json and use it with either one of the two:

"twitter": {
  "custom_params": {"x_auth_access_type": "read"}
}
"twitter": {
  "scope": ["read"]
}
chez14 commented 2 years ago

Thank you so much! It works at my end.

With write scope With read scope
image image
simov commented 2 years ago

Published in v5.4.21