Repository: ramosbugs/oauth2-rs (language: rust)

Issue:
Could you make Client's client id as pub?
Since Twitter's OAuth2 requires the client ID in the parameter as well, even though the urlencoded client ID is already included in the request body ( https://github.com/ramosbugs/oauth2-rs/blob/main/src/lib.rs#L1935 ), I would like Client struct to exposes the client_id parameter as pub or adding pub function.

I made little workaround to use this great library on twitter oauth2 as like
```Rust
// Get an auth token
let token = oauth_client
    .exchange_code(code)
    .add_extra_param("client_id", env::var("TWITTER_CLIENT_ID").context("Missing TWITTER_CLIENT_ID!").unwrap()) // Here!
    .set_pkce_verifier(session.get("pkce_code_verifier").unwrap())
    .request_async(async_http_client)
    .await
    .unwrap();
```


Discussion / hints:
Seconded, it would be nice for potentially all the fields to be public, just for convenience. But particularly for Twitter for the reason you have stated.
Sounds reasonable. Feel free to submit a PR!

Fix patch:
diff --git a/src/lib.rs b/src/lib.rs
index 45d4ba1..11e8474 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -965,6 +965,66 @@ where
             _phantom: PhantomData,
         })
     }
+
+    ///
+    /// Returns the Client ID.
+    ///
+    pub fn client_id(&self) -> &ClientId {
+        &self.client_id
+    }
+
+    ///
+    /// Returns the authorization endpoint.
+    ///
+    pub fn auth_url(&self) -> &AuthUrl {
+        &self.auth_url
+    }
+
+    ///
+    /// Returns the type of client authentication used for communicating with the authorization
+    /// server.
+    ///
+    pub fn auth_type(&self) -> &AuthType {
+        &self.auth_type
+    }
+
+    ///
+    /// Returns the token endpoint.
+    ///
+    pub fn token_url(&self) -> Option<&TokenUrl> {
+        self.token_url.as_ref()
+    }
+
+    ///
+    /// Returns the redirect URL used by the authorization endpoint.
+    ///
+    pub fn redirect_url(&self) -> Option<&RedirectUrl> {
+        self.redirect_url.as_ref()
+    }
+
+    ///
+    /// Returns the introspection URL for contacting the ([RFC 7662](https://tools.ietf.org/html/rfc7662))
+    /// introspection endpoint.
+    ///
+    pub fn introspection_url(&self) -> Option<&IntrospectionUrl> {
+        self.introspection_url.as_ref()
+    }
+
+    ///
+    /// Returns the revocation URL for contacting the revocation endpoint ([RFC 7009](https://tools.ietf.org/html/rfc7009)).
+    ///
+    /// See: [`revoke_token()`](Self::revoke_token())
+    ///
+    pub fn revocation_url(&self) -> Option<&RevocationUrl> {
+        self.revocation_url.as_ref()
+    }
+
+    ///
+    /// Returns the the device authorization URL used by the device authorization endpoint.
+    ///
+    pub fn device_authorization_url(&self) -> Option<&DeviceAuthorizationUrl> {
+        self.device_authorization_url.as_ref()
+    }
 }
 
 ///


Test patch: