def autologin_uri(redirect_uri, credentials, scope = nil)
    headers = {'content-type' => FORM_UTF8, 'accept' => JSON_UTF8,
        'authorization' => Http.basic_auth(@client_id, @client_secret) }
    body = Util.encode_form(credentials)
    reply = json_parse_reply(nil, *request(@target, :post, "/autologin", body, headers))
    raise BadResponse, "no autologin code in reply" unless reply['code']
    @target + authorize_path_args('code', redirect_uri, scope,
        random_state, :code => reply['code'])
  end
def autologin_uri(redirect_uri, credentials, scope = nil)
    headers = {'content-type' => FORM_UTF8, 'accept' => JSON_UTF8,
        'authorization' => Http.basic_auth(@client_id, @client_secret) }
    body = Util.encode_form(credentials)
    reply = json_parse_reply(nil, *request(@target, :post, "/autologin", body, headers))
    raise BadResponse, "no autologin code in reply" unless reply['code']
    @target + authorize_path_args('code', redirect_uri, scope,
        random_state, :code => reply['code'])
  end
A UAA extension to OAuth2 that allows a client to pre-authenticate a
 user at the start of an authorization code flow. By passing in the
 user's credentials the server can establish a session with the user's
 browser without reprompting for authentication. This is useful for
 user account management apps so that they can create a user account,
 or reset a password for the user, without requiring the user to type
 in their credentials again.
 @param [String] credentials (see #implicit_grant_with_creds)
 @param [String] redirect_uri (see #authcode_uri)
 @return (see #authcode_uri)