OAuthSettings.userSession

User login helper method, complementary to userAuthUri.

Use this method to start a session with user impersonation. The authorizationCode MUST be obtained by redirection of the user agent to an URI obtained through userAuthUri, otherwise there would not be a valid state.

  1. OAuthSession userSession(Session httpSession, string state, string authorizationCode)
    class OAuthSettings
    final immutable
    userSession
    (
    scope Session httpSession
    ,
    string state
    ,)
    out (result) { assert (result !is null); }
  2. OAuthSession userSession(string username, string password, string[] scopes)

Parameters

httpSession Session

The current HTTP session.

state string

OAuth state obtained from the '_state' query string parameter of the request URL.

authorizationCode string

the authorization code obtained from the service. It will be in the 'code' parameter in the query string of the request being processed.

Return Value

The new session.

Throws

OAuthException if any of the latter two arguments is invalid or authentication fails otherwise.

Meta