IWsBackupGetUserAuthenticationToken Method
|
Note: This API is now obsolete.
This method returns the user authentication token requested by the rest requests.
Namespace:
Aruba.Cloud.WsBackup
Assembly:
Aruba.Cloud.WsBackup (in Aruba.Cloud.WsBackup.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax [OperationContractAttribute]
[ObsoleteAttribute("Use WsAuthentication instead")]
WsResult<UserToken> GetUserAuthenticationToken(
GetUserAuthenticationTokenRequest request
)
<OperationContractAttribute>
<ObsoleteAttribute("Use WsAuthentication instead")>
Function GetUserAuthenticationToken (
request As GetUserAuthenticationTokenRequest
) As WsResult(Of UserToken)
[OperationContractAttribute]
[ObsoleteAttribute(L"Use WsAuthentication instead")]
WsResult<UserToken^>^ GetUserAuthenticationToken(
GetUserAuthenticationTokenRequest^ request
)
[<OperationContractAttribute>]
[<ObsoleteAttribute("Use WsAuthentication instead")>]
abstract GetUserAuthenticationToken :
request : GetUserAuthenticationTokenRequest -> WsResult<UserToken>
function GetUserAuthenticationToken(
request : GetUserAuthenticationTokenRequest
) : WsResult<UserToken>
Parameters
- request
- Type: GetUserAuthenticationTokenRequest
Return Value
Type:
WsResultUserTokenUser authentication token
Examples
Each user is associated with a unique token, valid for 30 minutes, that certifies that the service has been authenticated. If you have a valid token you can make calls to WSEndUser methods. After each call to any Aruba WSEndUser method the service actually checks for an invalid token for the account specified. If this does not exist, or if the token has expired, you will need to authenticate it again to get it.
In reality, the token is a substitute for password that has a temporary validity.
The APIs are authenticated with the pair username + password or username+valid token.
Getting the token for to recall the APIs is not mandatory.
The GetUserAuthenticationToken (WsCommon) and GetUserAuthenticationToken (WsEndUser) methods cannot be called with the username + token for security reasons.
The example generates an authentication token and associates it with the account indicated.
private static void LoginToAccount(WsEndUserClient client)
{
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";
try
{
WsResultOfUserToken result = client.GetUserAuthenticationToken();
if (result.Success)
{
}
else
{
throw new Exception(result.ResultMessage);
}
}
catch (MessageSecurityException msEx)
{
throw new Exception(msEx.Message);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
See Also