Class: KeycloakAdmin::TokenRepresentation

Inherits:
Representation show all
Defined in:
lib/keycloak-admin/representation/token_representation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Representation

#as_json, from_json, #to_json

Methods included from CamelJson

#camelize

Constructor Details

#initialize(access_token, token_type, expires_in, refresh_token, refresh_expires_in, id_token, not_before_policy, session_state) ⇒ TokenRepresentation

Returns a new instance of TokenRepresentation.



13
14
15
16
17
18
19
20
21
22
# File 'lib/keycloak-admin/representation/token_representation.rb', line 13

def initialize(access_token, token_type, expires_in, refresh_token, refresh_expires_in, id_token, not_before_policy, session_state)
  @access_token       = access_token
  @token_type         = token_type
  @expires_in         = expires_in
  @refresh_token      = refresh_token
  @refresh_expires_in = refresh_expires_in
  @id_token           = id_token
  @not_before_policy  = not_before_policy
  @session_state      = session_state
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def access_token
  @access_token
end

#expires_inObject

Returns the value of attribute expires_in.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def expires_in
  @expires_in
end

#id_tokenObject

Returns the value of attribute id_token.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def id_token
  @id_token
end

#not_before_policyObject

Returns the value of attribute not_before_policy.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def not_before_policy
  @not_before_policy
end

#refresh_expires_inObject

Returns the value of attribute refresh_expires_in.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def refresh_expires_in
  @refresh_expires_in
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def refresh_token
  @refresh_token
end

#session_stateObject

Returns the value of attribute session_state.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def session_state
  @session_state
end

#token_typeObject

Returns the value of attribute token_type.



4
5
6
# File 'lib/keycloak-admin/representation/token_representation.rb', line 4

def token_type
  @token_type
end

Class Method Details

.from_hash(hash) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/keycloak-admin/representation/token_representation.rb', line 24

def self.from_hash(hash)
  new(
    hash["access_token"],
    hash["token_type"],
    hash["expires_in"],
    hash["refresh_token"],
    hash["refresh_expires_in"],
    hash["id_token"],
    hash["not-before-policy"],
    hash["session_state"],
    )
end