Create a web browser session

Create a web browser session from the session verification token.

Create a web session for the current domain. Creating a web session requires that the user is already authenticated through the GmaApi, and that a session verification token exists for the user.

Method

[GET | POST]

/EAI/api/session/createSessionFromToken

Example cURL request

curl -X POST -d "token=7470f51f-2f5f-470e-8bea-402ae678bafb&redirect=https://your.site.com/protectedResource" https://gateway.domain.com/EAI/api/session/createSessionFromToken

Request parameters

A JSON payload that contains the following parameters.

Table 1. Request parameters
Parameter name Description
token Optional. The user's sessionVerificationToken value, if you are creating a session for a user who authenticated through the GmaApi.
redirect Optional. The URL to send the user after you resume the session.

Returns

200:. Customer-specific configuration might result in a 200 with JavaScript: redirect to the location specified.
302: Redirect.
LSG-SESSION-ID: LSG-SESSION-ID cookie that represents the user's SMS session ID handle.
WebSEAL: Session cookies for the user's WebSEAL session (PD-S-SESSION-ID). If a failure occurs, WebSEAL redirects to the configured error page.

Example sequence of commands

  1. Authenticate the user by invoking the username and password form data:

    curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -H "Authorization: Basic ZWFpLWNsaWVudDo=" -d "grant_type=password&username=userid&password=user_password" https://gateway.domain.com/EAI/oauth/token

    Where the userid value is the user's gtwyPrincipalName attribute value, and user_password is the user's password attribute value.
  2. Make a GET request, placing the OAuthbearer token, returned from step 1, into the Authentication Header:

    curl -H "Authorization: Bearer 56d512a9-4fa34ac6-a72a-76d66ed84d21" https://gateway.do main.com/EAI/api/me/startWebSession

  3. Make a GET request, placing the entry value returned into the query string. Use a field name of token for this value:

    curl https://gateway.domain.com/EAI/api/session/createSessionFromToken?token =4683caf7-c937-4edc-8105-bfa075f4d6ff -v

The return here includes a PD-S-SESSION-ID that can be used for getSession.

Note: There are differences in syntax between the operating systems: Windows, Linux®, and Mac. For instance, in Windows, you do not need quotation marks.