jpopesculian / twitter-v2-rs

Rust bindings for Twitter API v2
https://docs.rs/twitter-v2/latest
102 stars 28 forks source link

authorization: support public oauth client #20

Closed tommilligan closed 1 year ago

tommilligan commented 1 year ago

Twitter supports both Confidential and Public clients for OAuth apps. Public clients do not require a client secret for use; see on this page, the "Confidential Clients" section: https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code

Currently, Oauth2Client requires a client secret for use, when this is not actually required by the underlying api.

This PR adds a new constructor, Oauth2Client::new_public, which maintaining the type signature of Oauth2Client::new for back-compatibility.