Provides access to authentication information and methods for logging on to Ditto Cloud. Relevant when using an OnlineWithAuthentication
or an Online
identity.
More...
|
async Task< DittoError > | LoginWithToken (string token, string provider) |
| Log in to Ditto with a third-party token. More...
|
|
async Task< DittoError > | LoginWithCredentials (string username, string password, string provider) |
| Log in to Ditto with a username and password. More...
|
|
bool | IsAuthenticated () |
| Query whether Ditto has a valid authentication token. This will only be true when using an OnlineWithAuthentication or an Online identity, after a successful login. If the authentication token is allowed to expire then it will return false instead. More...
|
|
|
string? | UserId [get] |
| Gets the currently logged-in user ID. More...
|
|
Provides access to authentication information and methods for logging on to Ditto Cloud. Relevant when using an OnlineWithAuthentication
or an Online
identity.
◆ IsAuthenticated()
bool DittoSDK.DittoAuthenticator.IsAuthenticated |
( |
| ) |
|
|
inline |
Query whether Ditto has a valid authentication token. This will only be true
when using an OnlineWithAuthentication
or an Online
identity, after a successful login. If the authentication token is allowed to expire then it will return false
instead.
- Returns
- True if there is a valid login to the remote authentication service, otherwise false.
◆ LoginWithCredentials()
async Task<DittoError> DittoSDK.DittoAuthenticator.LoginWithCredentials |
( |
string |
username, |
|
|
string |
password, |
|
|
string |
provider |
|
) |
| |
|
inline |
Log in to Ditto with a username and password.
- Parameters
-
username | The username component of the credentials used for log in. |
password | The password component of the credentials used for log in. |
provider | The name of the authentication provider. |
- Returns
- A
DittoError
if the login attempt failed, otherwise null
.
◆ LoginWithToken()
async Task<DittoError> DittoSDK.DittoAuthenticator.LoginWithToken |
( |
string |
token, |
|
|
string |
provider |
|
) |
| |
|
inline |
Log in to Ditto with a third-party token.
- Parameters
-
token | The authentication token required to log in. |
provider | The name of the authentication provider. |
- Returns
- A
DittoError
if the login attempt failed, otherwise null
.
◆ UserId
string? DittoSDK.DittoAuthenticator.UserId |
|
get |
Gets the currently logged-in user ID.
This will be null
if there is no valid authentication or OnlineWithAuthentication
/Online
mode is not being used.