instance method
encode_credentials
Ruby on Rails 7.0.10
Since v3.0.20Signature
encode_credentials(token, options = {})
Encodes the given token and options into an Authorization header value.
Returns String.
Parameters
-
token- String token. -
options- Optional Hash of the options.
Parameters
-
tokenreq -
optionsopt = {}
Source
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 527
def encode_credentials(token, options = {})
values = ["#{TOKEN_KEY}#{token.to_s.inspect}"] + options.map do |key, value|
"#{key}=#{value.to_s.inspect}"
end
"Token #{values * ", "}"
end
Defined in actionpack/lib/action_controller/metal/http_authentication.rb line 527
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::HttpAuthentication::Token