token_params_from

token_params_from(auth) Instance Public methods

token_and_options

token_and_options(request) Instance Public methods Parses the token and options out of the token authorization header. If the header looks like this: Authorization: Token token="abc", nonce="def" Then the returned token is âabcâ, and the options is {nonce: âdefâ} request - ActionDispatch::Request instance with the current headers. Returns an Array of [String, Hash] if a token is present. Returns nil if no token is found.

rewrite_param_values

rewrite_param_values(array_params) Instance Public methods This removes the `â` characters wrapping the value.

raw_params

raw_params(auth) Instance Public methods This method takes an authorization body and splits up the key-value pairs by the standardized `:`, `;`, or `t` delimiters defined in `AUTHN_PAIR_DELIMITERS`.

params_array_from

params_array_from(raw_params) Instance Public methods Takes #raw_params and turns it into an array of parameters

encode_credentials

encode_credentials(token, options = {}) Instance Public methods Encodes the given token and options into an Authorization header value. token - String token. options - optional Hash of the options. Returns String.

authentication_request

authentication_request(controller, realm) Instance Public methods Sets a WWW-Authenticate to let the client know a token is desired. controller - ActionController::Base instance for the outgoing response. realm - String realm to use in the header. Returns nothing.

authenticate

authenticate(controller, &login_procedure) Instance Public methods If token Authorization header is present, call the login procedure with the present token and options. controller ActionController::Base instance for the current request. login_procedure Proc to call if a token is present. The Proc should take two arguments: authenticate(controller) { |token, options| ... } Returns the return value of login_procedure if a token is found. Returns nil if no token is found

request_http_token_authentication

request_http_token_authentication(realm = "Application") Instance Public methods

authenticate_with_http_token

authenticate_with_http_token(&login_procedure) Instance Public methods