Struct onedrive_api::Auth [−][src]
pub struct Auth { /* fields omitted */ }Implementations
impl Auth[src]
impl Auth[src]pub fn new(
client_id: String,
permission: Permission,
redirect_uri: String
) -> Self[src]
client_id: String,
permission: Permission,
redirect_uri: String
) -> Self
Create an new instance for OAuth2 to Microsoft Graph with specified client identifier and permission.
pub fn new_with_client(
client: Client,
client_id: String,
permission: Permission,
redirect_uri: String
) -> Self[src]
client: Client,
client_id: String,
permission: Permission,
redirect_uri: String
) -> Self
Same as Auth::new but with custom reqwest::Client.
pub fn client_id(&self) -> &str[src]
Get the client_id used to create this instance.
pub fn permission(&self) -> &Permission[src]
Get the permission used to create this instance.
pub fn redirect_uri(&self) -> &str[src]
Get the redirect_uri used to create this instance.
pub fn code_auth_url(&self) -> String[src]
pub async fn login_with_code(
&self,
code: &str,
client_secret: Option<&str>
) -> Result<TokenResponse>[src]
&self,
code: &str,
client_secret: Option<&str>
) -> Result<TokenResponse>
pub async fn login_with_refresh_token(
&self,
refresh_token: &str,
client_secret: Option<&str>
) -> Result<TokenResponse>[src]
&self,
refresh_token: &str,
client_secret: Option<&str>
) -> Result<TokenResponse>
Login using a refresh token.
This requires offline_access, and will ALWAYS return
a new refresh_token if success.
Panic
Panic if the current Auth is created with no
offline_access permission.
See also
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Auth
impl !RefUnwindSafe for Authimpl !UnwindSafe for Auth
impl !UnwindSafe for AuthBlanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]