Skip to main content

Social

Struct Social 

Source
pub struct Social { /* private fields */ }
Expand description

 Social Data representing the social module.

Implementations§

Source§

impl Social

Source

pub fn new(oauth_client: Auth0Client) -> Self

Create a new Social object.

§Parameters
  • oauth_client - The Auth0Client to use to interact with Auth0 APIs.
Source

pub async fn authorize( &self, client_id: &str, response_type: &str, redirect_uri: &str, scope: &str, state: &str, ) -> Result<String, Box<dyn Error>>

Authenticate a user with a social provider.

§Parameters
  • client_id - The client ID of your Auth0 application.
  • response_type - The type of response you want from Auth0. This should be “code”.
  • redirect_uri - The URL to which Auth0 will redirect the browser after authorization has been granted by the user.
  • scope - The scopes which you want to request authorization for. These must be separated by a space.
  • state - An opaque value used to prevent CSRF attacks.
Source

pub async fn get_access_token( &self, client_id: &str, client_secret: &str, audience: &str, grant_type: &str, ) -> Result<String, Box<dyn Error>>

Get an access token from Auth0.

§Parameters
  • client_id - The client ID of your Auth0 application.
  • client_secret - The client secret of your Auth0 application.
  • audience - The audience of your Auth0 application.
  • grant_type - The grant type for the token request. This should be “client_credentials”.
Source

pub async fn get_user_info( &self, access_token: &str, ) -> Result<String, Box<dyn Error>>

Get user information from Auth0.

§Parameters
  • access_token - The access token obtained from the get_access_token method.
Source

pub async fn logout( &self, client_id: &str, return_to: &str, ) -> Result<String, Box<dyn Error>>

Log out a user from Auth0.

§Parameters
  • client_id - The client ID of your Auth0 application.
  • return_to - The URL to which Auth0 will redirect the browser after logout.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more