[−][src]Struct rocket_oauth2::HyperSyncRustlsAdapter
The default Adapter
implementation. Uses hyper
and rustls
to perform the token exchange.
By defualt, this adapter will use HTTP Basic Authentication. If this is
not supported by your authorization server, the basic_auth
method
can be used to change this behavior.
Implementations
impl HyperSyncRustlsAdapter
[src]
pub fn basic_auth(self, use_basic_auth: bool) -> Self
[src]
Sets whether or not this adapter will use HTTP Basic Authentication. Although servers are required to support it (RFC 6749 §2.3.1), not all do.
If this is set to false
, the client_id
and client_secret
will be
sent as part of the request body instead of an Authorization
header.
Example
use rocket::fairing::AdHoc; use rocket_oauth2::{HyperSyncRustlsAdapter, OAuth2, OAuthConfig, StaticProvider}; struct MyProvider; fn main() { rocket::ignite() .attach(AdHoc::on_attach("OAuth Config", |rocket| { let config = OAuthConfig::from_config(rocket.config(), "my_provider").unwrap(); Ok(rocket.attach(OAuth2::<MyProvider>::custom( HyperSyncRustlsAdapter::default().basic_auth(false), config) )) })) .launch(); }
Trait Implementations
impl Adapter for HyperSyncRustlsAdapter
[src]
fn authorization_uri(
&self,
config: &OAuthConfig,
state: &str,
scopes: &[&str],
extras: &[(&str, &str)]
) -> Result<Absolute<'static>, Error>
[src]
&self,
config: &OAuthConfig,
state: &str,
scopes: &[&str],
extras: &[(&str, &str)]
) -> Result<Absolute<'static>, Error>
fn exchange_code(
&self,
config: &OAuthConfig,
token: TokenRequest
) -> Result<TokenResponse<()>, Error>
[src]
&self,
config: &OAuthConfig,
token: TokenRequest
) -> Result<TokenResponse<()>, Error>
impl Clone for HyperSyncRustlsAdapter
[src]
fn clone(&self) -> HyperSyncRustlsAdapter
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HyperSyncRustlsAdapter
[src]
impl Default for HyperSyncRustlsAdapter
[src]
Auto Trait Implementations
impl RefUnwindSafe for HyperSyncRustlsAdapter
impl Send for HyperSyncRustlsAdapter
impl Sync for HyperSyncRustlsAdapter
impl Unpin for HyperSyncRustlsAdapter
impl UnwindSafe for HyperSyncRustlsAdapter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,