pub struct GitHub { /* private fields */ }Expand description
GitHub. Make an OAuth app in GitHub’s settings (Developer settings →
OAuth Apps) with the callback URL APP_URL/auth/github/callback.
Implementations§
Trait Implementations§
Source§impl Provider for GitHub
impl Provider for GitHub
Source§fn name(&self) -> &str
fn name(&self) -> &str
The provider’s name in URLs (
/auth/google/redirect) and in the
oauth_accounts table: short, lower case, never changed once users
linked accounts.Source§fn credentials(&self) -> &Credentials
fn credentials(&self) -> &Credentials
The app’s client id and secret, from the provider’s console.
Where the browser goes to approve the sign-in.
Source§fn token_endpoint(&self) -> &str
fn token_endpoint(&self) -> &str
Where the code is exchanged for a token.
Source§fn profile<'a>(
&'a self,
http: &'a Http,
token: &'a Token,
) -> BoxFuture<'a, Result<Profile>>
fn profile<'a>( &'a self, http: &'a Http, token: &'a Token, ) -> BoxFuture<'a, Result<Profile>>
Who the token belongs to. Return a
Refused error when the account
is not one this app accepts (another tenant, another domain): the
visitor is told so, and OAuthRefused is announced.Other parameters for the authorization URL, e.g. Google’s
prompt.Source§fn exchange<'a>(
&'a self,
http: &'a Http,
request: TokenRequest,
) -> BoxFuture<'a, Result<Token>>
fn exchange<'a>( &'a self, http: &'a Http, request: TokenRequest, ) -> BoxFuture<'a, Result<Token>>
Exchanges the authorization code for a token. The default sends the
standard request (
exchange_code); override it for a provider that
does something else.Source§fn with_config(&self, _config: &Config) -> Option<Arc<dyn Provider>>
fn with_config(&self, _config: &Config) -> Option<Arc<dyn Provider>>
A copy of this provider with the settings it reads from the
configuration besides the credentials (Microsoft’s
MICROSOFT_TENANT),
resolved. The module calls it for each request; the default, None,
means there is nothing to resolve.Auto Trait Implementations§
impl Freeze for GitHub
impl RefUnwindSafe for GitHub
impl Send for GitHub
impl Sync for GitHub
impl Unpin for GitHub
impl UnsafeUnpin for GitHub
impl UnwindSafe for GitHub
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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