Class: KeycloakSdk::OidcEndpoints

Inherits:
Object
  • Object
show all
Defined in:
lib/keycloak_sdk/oidc_endpoints.rb

Overview

Keycloak realm의 OIDC 엔드포인트를 규약대로 조립한다(네트워크 없음).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_url, realm) ⇒ OidcEndpoints

Returns a new instance of OidcEndpoints.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 8

def initialize(server_url, realm)
  base = "#{server_url}/realms/#{realm}"
  oidc = "#{base}/protocol/openid-connect"
  @issuer = base
  @authorization = "#{oidc}/auth"
  @token = "#{oidc}/token"
  @introspection = "#{oidc}/token/introspect"
  @end_session = "#{oidc}/logout"
  @jwks = "#{oidc}/certs"
  freeze
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def authorization
  @authorization
end

#end_sessionObject (readonly)

Returns the value of attribute end_session.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def end_session
  @end_session
end

#introspectionObject (readonly)

Returns the value of attribute introspection.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def introspection
  @introspection
end

#issuerObject (readonly)

Returns the value of attribute issuer.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def issuer
  @issuer
end

#jwksObject (readonly)

Returns the value of attribute jwks.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def jwks
  @jwks
end

#tokenObject (readonly)

Returns the value of attribute token.



6
7
8
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 6

def token
  @token
end

Class Method Details

.from_config(config) ⇒ Object



20
21
22
# File 'lib/keycloak_sdk/oidc_endpoints.rb', line 20

def self.from_config(config)
  new(config.server_url, config.realm)
end