pub struct Provider {
pub name: &'static str,
pub authorize_url: &'static str,
pub token_url: &'static str,
pub userinfo_url: &'static str,
pub scopes: &'static str,
pub client_id_secret: &'static str,
pub client_secret_secret: &'static str,
}Expand description
An OAuth 2.0 provider: its endpoints and the scopes Ocre asks for.
Use GITHUB or GOOGLE; provider finds one by name.
§Examples
let github = ocre::oauth::provider("github").unwrap();
assert_eq!(github.token_url, "https://github.com/login/oauth/access_token");
assert_eq!(github.client_id_secret, "GITHUB_CLIENT_ID");Fields§
§name: &'static strLowercase name, used in routes (/auth/github) and stored with identities.
Where the browser is sent to sign in and approve the app.
token_url: &'static strWhere the Worker trades the code for an access token.
userinfo_url: &'static strWhere the Worker reads the signed-in user.
scopes: &'static strSpace-separated scopes: the user’s identity and email address only.
client_id_secret: &'static strName of the Worker secret holding the OAuth app’s client id.
client_secret_secret: &'static strName of the Worker secret holding the OAuth app’s client secret.
Trait Implementations§
impl Eq for Provider
impl StructuralPartialEq for Provider
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnsafeUnpin for Provider
impl UnwindSafe for Provider
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.