Session Manager Login By Token

Session Manager Login By Token

Log on to the server through token representing principal identity.

The token is obtained from SSO (single sign-on) service. This method fails if the token is not valid, or the principal has no permissions granted. Two type of sso tokens are supported by this method: Bearer and Holder-of-Key (HoK). If the token type obliges the method caller to prove his rights to present this token (HoK), then a signature is supplied as well. The token and the security signature if available are provided in a transport specific way.

If the communication with the VirtualCenter is SOAP based read the WS-Security specification (SAML Token profile) to understand how to transport the SSO token and signature.

Usual login scenario:

  1. Acquire HoK token from the SSO service. Different authentication mechanisms are available for acquiring token (user/password, certificate, SSPI and so on). For more details consult the SSO documentation. To find the location of your SSO service consult the Virtual Infrastructure documentation.
  2. Once SSO token is acquired successfully LoginByToken could be invoked.

Required privileges: System.Anonymous

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/SessionManager/{moId}/LoginByToken
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case SessionManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
LoginByTokenRequestType of type(s) application/json
Required
{
    "locale": "string"
}
string
locale
Optional

A two-character ISO-639 language ID (like "en") optionally followed by an underscore and a two-character ISO 3166 country ID (like "US").

Examples are "de", "fr_CA", "zh", "zh_CN", and "zh_TW". Note: The method uses the server default locale when a locale is not provided. This default can be configured in the server configuration file. If unspecified, it defaults to the locale of the server environment or English ("en") if unsupported.

Authentication
This operation uses the following authentication methods.
Responses
200

The UserSession object.

Returns UserSession of type(s) application/json
This response body class contains all of the following: DataObject
{
    "_typeName": "string",
    "key": "string",
    "userName": "string",
    "fullName": "string",
    "loginTime": "string",
    "lastActiveTime": "string",
    "locale": "string",
    "messageLocale": "string",
    "extensionSession": false,
    "ipAddress": "string",
    "userAgent": "string",
    "callCount": 0
}
string
key
Required

A unique identifier for this session, also known as the session ID.

string
userName
Required

The user name represented by this session.

string
fullName
Required

The full name of the user, if available.

string As date-time As date-time
loginTime
Required

Timestamp when the user last logged on to the server.

string As date-time As date-time
lastActiveTime
Required

Timestamp when the user last executed a command.

string
locale
Required

The locale for the session used for data formatting and preferred for messages.

string
messageLocale
Required

The locale used for messages for the session.

If there are no localized messages for the user-specified locale, then the server determines this locale.

boolean
extensionSession
Required

Whether or not this session belongs to a VC Extension.

string
ipAddress
Required

The client identity.

It could be IP address, or pipe name depended on client binding

string
userAgent
Required

The name of user agent or application

integer As int64 As int64
callCount
Required

Number of API invocations since the session started


500

InvalidLogin: if there is no token provided or the token could not be validated.

NoPermission: if the principal is valid, but has no access granted.

InvalidLocale: if the locale is invalid or unknown to the server.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}