Click or drag to resize

IWsCommonGetUserAuthenticationToken Method

Note: This API is now obsolete.

The method generates an authentication token and associates it with the account indicated. Each user is assigned a unique token, valid for a few hours, certifying the authentication service. If you have a valid token you can make calls to methods of WSEndUser.After each call to any method of Aruba WSEndUser, the service checks for a valid token for the account that you specify. If this does not exist, or if the token is found to be expired, you will need to authenticate again to get it.

Namespace:  Aruba.Cloud.WsCommon
Assembly:  Aruba.Cloud.WsCommon (in Aruba.Cloud.WsCommon.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
[ObsoleteAttribute("Use WsAuthentication instead")]
WsResult<UserToken> GetUserAuthenticationToken(
	GetUserAuthenticationTokenRequest userAuthenticationTokenRequest
)

Parameters

userAuthenticationTokenRequest
Type: GetUserAuthenticationTokenRequest

Return Value

Type: WsResultUserToken
Examples
//IWsCommon.GetUserAuthenticationToken Method (c# .NET)
private static void LoginToWsCommon(WsCommonClient client)
{
//specify the account credentials
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";

try
{
WsResultOfUserToken result = client.GetUserAuthenticationToken();

if (result.Success)
{
//the method was successful
}
else
{
throw new Exception(result.ResultMessage);
}
}
catch (MessageSecurityException msEx)
{
//user not authenticated
throw new Exception(msEx.Message);
}
catch (Exception ex)
{
//generic exception
throw new Exception(ex.Message);
}
}

//IWsEndUser.GetUserAuthenticationToken Method (c# .NET)
private static void LoginToWsEndUser(WsEndUserClient client)
{
//specify the account credentials
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";

try
{
var result = client.GetUserAuthenticationToken();

if (result.Success)
{
//the method was successful
}
else
{
throw new Exception(result.ResultMessage);
}
}
catch (MessageSecurityException msEx)
{
//user not authenticated
throw new Exception(msEx.Message);
}
catch (Exception ex)
{
//generic exception
throw new Exception(ex.Message);
}
}
See Also