Class: Masks::OpenID::DiscoveriesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/masks/openid/discoveries_controller.rb

Instance Method Summary collapse

Methods included from Controller

#current_access, #current_actor, #current_mask, #masked_session

Instance Method Details

#jwksObject



7
8
9
10
11
12
13
14
# File 'app/controllers/masks/openid/discoveries_controller.rb', line 7

def jwks
  jwks =
    JSON::JWK::Set.new(
      JSON::JWK.new(client.public_key, use: :sig, kid: client.kid)
    )

  render json: jwks
end

#newObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/masks/openid/discoveries_controller.rb', line 16

def new
  render json:
           OpenIDConnect::Discovery::Provider::Config::Response.new(
             issuer: client.issuer,
             authorization_endpoint: openid_authorization_url,
             token_endpoint: openid_token_url,
             userinfo_endpoint: openid_userinfo_url,
             jwks_uri: openid_jwks_url,
             #  registration_endpoint: site_url, # TODO
             scopes_supported: client.scopes,
             response_types_supported: client.response_types,
             grant_types_supported: client.grant_types,
             claims_parameter_supported: false,
             request_parameter_supported: false,
             request_uri_parameter_supported: false,
             subject_types_supported: [
               client.pairwise_subject? ? "pairwise" : "public"
             ],
             id_token_signing_alg_values_supported: [:RS256],
             token_endpoint_auth_methods_supported: %w[
               client_secret_basic
               client_secret_post
             ],
             claims_supported: %w[sub iss name email address phone_number]
           )
end