Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
ICloudAuthentication Interface Reference

Implements a way to log in / log out to Kanda Cloud with OpenID Connect and getting credentials from this process for use in authenticating API requests. More...

+ Inheritance diagram for ICloudAuthentication:

Public Member Functions

Task< CloudCredentialsGetCredentials (CancellationToken cancellationToken)
 Gets the current credentials stored for Kanda Cloud. If credentials expire soon, they will be renewed first.
 
Task< bool > TryLoginWithSavedCredentials (CancellationToken cancellationToken)
 Try to login using credentials saved with UserSettingsService.
 
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.
 
Task Logout ()
 Logs out of Kanda Cloud and clears local credentials.
 

Properties

bool IsLoggedIn [get]
 If true, the user is logged in.
 

Events

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

Implements a way to log in / log out to Kanda Cloud with OpenID Connect and getting credentials from this process for use in authenticating API requests.

Member Function Documentation

◆ GetCredentials()

Task< CloudCredentials > GetCredentials ( CancellationToken cancellationToken)

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

Implemented in CloudAuthentication.

◆ Logout()

Task Logout ( )

Logs out of Kanda Cloud and clears local credentials.

Implemented in CloudAuthentication.

◆ StartLoginWithDeviceCode()

Task< DeviceCodeLoginData > StartLoginWithDeviceCode ( 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.

Implemented in CloudAuthentication.

◆ TryLoginWithSavedCredentials()

Task< bool > TryLoginWithSavedCredentials ( CancellationToken cancellationToken)

Try to login using credentials saved with UserSettingsService.

Returns
True if valid credentials could be found.

Implemented in CloudAuthentication.

Property Documentation

◆ IsLoggedIn

bool IsLoggedIn
get

If true, the user is logged in.

Implemented in CloudAuthentication.


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