Class: CF::UAA::TokenInfo
- Inherits:
-
Object
- Object
- CF::UAA::TokenInfo
- Defined in:
- lib/uaa/token_issuer.rb
Overview
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 #info for contents.
Instance Attribute Summary collapse
-
#info ⇒ Hash
readonly
Information about the current token.
Instance Method Summary collapse
-
#auth_header ⇒ String
Constructs a string for use in an authorization header from the contents of the TokenInfo.
-
#initialize(info) ⇒ TokenInfo
constructor
Normally instantiated by TokenIssuer.
Constructor Details
#initialize(info) ⇒ TokenInfo
Normally instantiated by CF::UAA::TokenIssuer.
34 |
# File 'lib/uaa/token_issuer.rb', line 34 def initialize(info) @info = info end |
Instance Attribute Details
#info ⇒ Hash (readonly)
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.
31 32 33 |
# File 'lib/uaa/token_issuer.rb', line 31 def info @info end |
Instance Method Details
#auth_header ⇒ String
Constructs a string for use in an authorization header from the contents of the TokenInfo.
39 40 41 |
# File 'lib/uaa/token_issuer.rb', line 39 def auth_header "#{@info[:token_type] || @info['token_type']} #{@info[:access_token] || @info['access_token']}" end |