Struct scl_core::auth::microsoft::MicrosoftOAuth
source · pub struct MicrosoftOAuth<T> { /* private fields */ }
Expand description
使用设备流方式验证的微软账户验证对象
使用这个对象前,你需要通过 Azure Active Directory 注册一个应用,并将其客户端 ID 提供至此使用。
Implementations§
source§impl<T: Display> MicrosoftOAuth<T>
impl<T: Display> MicrosoftOAuth<T>
sourcepub async fn get_devicecode(&self) -> Result<DeviceCodeResponse>
pub async fn get_devicecode(&self) -> Result<DeviceCodeResponse>
获取一个设备码,将其展示给用户以完成浏览器验证
sourcepub async fn verify_device_code(
&self,
device_code: &str
) -> Result<TokenResponse>
pub async fn verify_device_code( &self, device_code: &str ) -> Result<TokenResponse>
获取/验证设备码的验证情况
sourcepub async fn start_auth(
&self,
access_token: &str,
refresh_token: &str
) -> Result<AuthMethod>
pub async fn start_auth( &self, access_token: &str, refresh_token: &str ) -> Result<AuthMethod>
通过设备码验证获取到的 Microsoft 访问令牌获取 Minecraft 账户
sourcepub async fn refresh_auth(&self, method: &mut AuthMethod) -> Result<()>
pub async fn refresh_auth(&self, method: &mut AuthMethod) -> Result<()>
刷新登录令牌,如刷新成功则可将更新后的用户继续用于正版启动
Auto Trait Implementations§
impl<T> RefUnwindSafe for MicrosoftOAuth<T>where T: RefUnwindSafe,
impl<T> Send for MicrosoftOAuth<T>where T: Send,
impl<T> Sync for MicrosoftOAuth<T>where T: Sync,
impl<T> Unpin for MicrosoftOAuth<T>where T: Unpin,
impl<T> UnwindSafe for MicrosoftOAuth<T>where T: UnwindSafe,
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