Enum graph_oauth::oauth::graphdiscovery::GraphDiscovery
source · pub enum GraphDiscovery {
V1,
V2,
Tenant(String),
}
Variants§
Implementations§
source§impl GraphDiscovery
impl GraphDiscovery
sourcepub fn url(&self) -> String
pub fn url(&self) -> String
Get the URL for the public keys used by the Microsoft identity platform to sign security tokens.
Example
let url = GraphDiscovery::V1.url();
println!("{}", url);
sourcepub fn signing_keys<T>(self) -> Result<T, OAuthError>where
for<'de> T: Deserialize<'de>,
pub fn signing_keys<T>(self) -> Result<T, OAuthError>where for<'de> T: Deserialize<'de>,
Get the public keys used by the Microsoft identity platform to sign security tokens.
Example
let keys: serde_json::Value = GraphDiscovery::V1.signing_keys().unwrap();
println!("{:#?}", keys);
sourcepub async fn async_signing_keys<T>(self) -> Result<T, OAuthError>where
for<'de> T: Deserialize<'de>,
pub async fn async_signing_keys<T>(self) -> Result<T, OAuthError>where for<'de> T: Deserialize<'de>,
sourcepub fn oauth(self) -> Result<OAuth, OAuthError>
pub fn oauth(self) -> Result<OAuth, OAuthError>
Automatically convert the public keys used by the Microsoft identity platform to sign security tokens into an OAuth object. This will get the common urls for authorization and access tokens and insert them into OAuth.
Example
let oauth = GraphDiscovery::V1.oauth().unwrap();
println!("{:#?}", oauth);
sourcepub async fn async_oauth(self) -> Result<OAuth, OAuthError>
pub async fn async_oauth(self) -> Result<OAuth, OAuthError>
Automatically convert the public keys used by the Microsoft identity platform to sign security tokens into an OAuth object. This will get the common urls for authorization and access tokens and insert them into OAuth.
Example
ⓘ
let oauth = GraphDiscovery::V1.async_oauth().await.unwrap();
println!("{:#?}", oauth);