Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
CloudAuthentication Class Reference

More...

+ Inheritance diagram for CloudAuthentication:

Public Member Functions

 CloudAuthentication (IPlatformSettings platformSettings, ICloudSettings cloudSettings, IUserSettingsService userSettings, IUnityHttpClient httpClient)
 
async Task< CloudCredentialsGetCredentials (CancellationToken cancellationToken=default)
 Gets the current credentials stored for Kanda Cloud. If credentials expire soon, they will be renewed first.
 
async Task< bool > TryLoginWithSavedCredentials (CancellationToken cancellationToken)
 Try to login using credentials saved with UserSettingsService.
Returns
True if valid credentials could be found.

 
async Task< DeviceCodeLoginDataStartLoginWithDeviceCode (CancellationToken cancellationToken)
 Initiates a login process with OpenID Connect using the Device Code grant. Once started, this will continue to poll in the background for device code activation. When the device code is activated or the process is aborted, a OnLogin or OnLoginError event is invoked.
Returns
Information about the device code flow, like whether it could be successfully started, the user code and activation URL.

 
async Task Logout ()
 Logs out of Kanda Cloud and clears local credentials.
 

Properties

bool IsLoggedIn [get]
 If true, the user is logged in.
 
- Properties inherited from ICloudAuthentication

Events

Action< LoginTypeOnLogin
 
Action OnLogout
 
Action< string > OnLoginError
 
Action OnSessionExpired
 
- Events inherited from ICloudAuthentication
Action< LoginTypeOnLogin
 Invoked when a login process has been successfully completed.
 
Action OnLogout
 Invoked when a logout process has been successfully completed.
 
Action< string > OnLoginError
 Invoked when a login process has completed with an error.
 
Action OnSessionExpired
 Invoked when Cloud credentials have expired and cannot be renewed.
 

Detailed Description

Member Function Documentation

◆ GetCredentials()

async Task< CloudCredentials > GetCredentials ( CancellationToken cancellationToken = default)
inline

Gets the current credentials stored for Kanda Cloud. If credentials expire soon, they will be renewed first.

Implements ICloudAuthentication.

◆ Logout()

async Task Logout ( )
inline

Logs out of Kanda Cloud and clears local credentials.

Implements ICloudAuthentication.

◆ StartLoginWithDeviceCode()

async Task< DeviceCodeLoginData > StartLoginWithDeviceCode ( CancellationToken cancellationToken)
inline

Initiates a login process with OpenID Connect using the Device Code grant. Once started, this will continue to poll in the background for device code activation. When the device code is activated or the process is aborted, a OnLogin or OnLoginError event is invoked.

Returns
Information about the device code flow, like whether it could be successfully started, the user code and activation URL.

Implements ICloudAuthentication.

◆ TryLoginWithSavedCredentials()

async Task< bool > TryLoginWithSavedCredentials ( CancellationToken cancellationToken)
inline

Try to login using credentials saved with UserSettingsService.

Returns
True if valid credentials could be found.

Implements ICloudAuthentication.

Property Documentation

◆ IsLoggedIn

bool IsLoggedIn
get

If true, the user is logged in.

Implements ICloudAuthentication.


The documentation for this class was generated from the following file: