OAuthWebapp.login

Perform OAuth login using the given _settings

The route mapped to this method should normally match the redirectUri set on the settings. If multiple providers are to be supported, there should be a different route for each provider, all mapped to this method, but with different settings.

If the request looks like a redirect back from the authentication server, settings.userSession is called to obtain an OAuthSession.

Otherwise, the user agent is redirected to the authentication server.

  1. bool login(HTTPServerRequest req, HTTPServerResponse res, OAuthSettings settings, string[string] extraParams, string[] scopes)
  2. bool login(HTTPServerRequest req, HTTPServerResponse res, OAuthSettings settings, string[] scopes)
    class OAuthWebapp
    @safe
    bool
    login
    (
    scope HTTPServerRequest req
    ,
    scope HTTPServerResponse res
    ,,
    in string[] scopes
    )

Parameters

req HTTPServerRequest

The request

res HTTPServerResponse

Response object to be used to redirect the client to the authentication server

settings OAuthSettings

The OAuth settings that apply to this login attempt

scopes string[]

(Optional) An array of identifiers specifying the scope of the authorization requested.

Return Value

Type: bool

true if a OAuth session was obtained and false if no OAuth session is present and a redirect to an OAuth provider will happen.

Meta