class CF::UAA::TokenInfo
The TokenInfo class is returned by various TokenIssuer methods. It holds access and refresh tokens as well as token meta-data such as token type and expiration time. See {TokenInfo#info} for contents.
Attributes
info[R]
Information about the current token. The info hash MUST include access_token, token_type and scope (if granted scope differs from requested scope). It should include expires_in. It may include refresh_token, scope, and other values from the auth server. @return [Hash]
Public Class Methods
new(info)
click to toggle source
Normally instantiated by {TokenIssuer}.
# File lib/uaa/token_issuer.rb, line 32 def initialize(info) @info = info end
Public Instance Methods
auth_header()
click to toggle source
Constructs a string for use in an authorization header from the contents of the TokenInfo. @return [String] Typically a string such as “bearer xxxx.xxxx.xxxx”.
# File lib/uaa/token_issuer.rb, line 37 def auth_header "#{@info[:token_type] || @info['token_type']} #{@info[:access_token] || @info['access_token']}" end