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.
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.
Example sequence of commands
- Authenticate the user by invoking the username and
password form data:
Where the userid value is the user's gtwyPrincipalName attribute value, and user_password is the user's password attribute value.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
- 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
- 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.