pub struct OAuth2Builder { /* private fields */ }Expand description
Sub-builder for OAuth 2.0 client credentials.
Entered via AuthBuilder::with_oauth2(); call done()
to return to the parent builder.
Implementations§
Source§impl OAuth2Builder
impl OAuth2Builder
Sourcepub fn client_id(self, client_id: impl Into<String>) -> Self
pub fn client_id(self, client_id: impl Into<String>) -> Self
Set OAuth2 client ID.
§Example
use auth_framework::prelude::*;
let builder = AuthFramework::builder()
.with_oauth2().client_id("my-client-id").done();Sourcepub fn client_secret(self, client_secret: impl Into<String>) -> Self
pub fn client_secret(self, client_secret: impl Into<String>) -> Self
Set OAuth2 client secret.
§Example
use auth_framework::prelude::*;
let builder = AuthFramework::builder()
.with_oauth2().client_id("id").client_secret("secret").done();Sourcepub fn redirect_uri(self, redirect_uri: impl Into<String>) -> Self
pub fn redirect_uri(self, redirect_uri: impl Into<String>) -> Self
Set redirect URI.
§Example
use auth_framework::prelude::*;
let builder = AuthFramework::builder()
.with_oauth2()
.client_id("id")
.redirect_uri("https://example.com/callback")
.done();Sourcepub fn google_client_id(self, client_id: impl Into<String>) -> Self
pub fn google_client_id(self, client_id: impl Into<String>) -> Self
Sourcepub fn github_client_id(self, client_id: impl Into<String>) -> Self
pub fn github_client_id(self, client_id: impl Into<String>) -> Self
Sourcepub fn done(self) -> AuthBuilder
pub fn done(self) -> AuthBuilder
Complete OAuth2 configuration and return to main builder.
§Example
use auth_framework::prelude::*;
let builder = AuthFramework::builder()
.with_oauth2().client_id("id").client_secret("secret").done();Auto Trait Implementations§
impl Freeze for OAuth2Builder
impl !RefUnwindSafe for OAuth2Builder
impl Send for OAuth2Builder
impl Sync for OAuth2Builder
impl Unpin for OAuth2Builder
impl UnsafeUnpin for OAuth2Builder
impl !UnwindSafe for OAuth2Builder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more