Add redirect url getter to client

This commit is contained in:
Matthew Scheirer 2017-09-23 22:37:04 -04:00
parent f4cf2fcea3
commit 08df147f5c
1 changed files with 6 additions and 1 deletions

View File

@ -102,7 +102,7 @@ type IdToken = Compact<Claims, Empty>;
/// OpenID Connect Client for a provider specified at construction. /// OpenID Connect Client for a provider specified at construction.
pub struct Client { pub struct Client {
pub oauth: inth_oauth2::Client<Discovered>, oauth: inth_oauth2::Client<Discovered>,
jwks: JWKSet<Empty>, jwks: JWKSet<Empty>,
} }
@ -142,6 +142,11 @@ impl Client {
} }
} }
/// Passthrough to the redirect_url stored in inth_oauth2 as a str.
pub fn redirect_url(&self) -> &str {
self.oauth.redirect_uri.as_ref().unwrap()
}
/// Passthrough to the inth_oauth2::client's request token. /// Passthrough to the inth_oauth2::client's request token.
pub fn request_token(&self, pub fn request_token(&self,
client: &reqwest::Client, client: &reqwest::Client,