AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# RemoteSessionFactory.GetTokenContext Method

Returns an `IRemoteSession` using the specified login token.

public static IRemoteSession GetTokenContext(
Uri endpoint,
string token
);

#### Parameters

endpoint
  The SOAP endpoint of the WS portal (ptapi). For example, a Java WS portal installation might use `http://hostname:port/ptapi/services/QueryInterfaceAPI` while a .NET WS portal might use `http://hostname:port/ptapi/QueryInterfaceAPI.asmx`. These endpoints will vary according to the deployment.
token
  The login token.

#### Return Value

An `IRemoteSession` object representing the current session with the portal.

#### Remarks

A login token can be obtained from a portal request to a portlet using `PortletRequest.GetLoginToken()`.

#### Exceptions

Exception Type | Condition
--- | ---
HttpException | The endpoint URL is not valid.

#### See Also

RemoteSessionFactory Class | Plumtree.Remote.PRC Namespace