Class: Iron::Oauth::MetadataController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/iron/oauth/metadata_controller.rb

Instance Method Summary collapse

Instance Method Details

#authorization_serverObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/iron/oauth/metadata_controller.rb', line 13

def authorization_server
  render json: {
    issuer: issuer,
    authorization_endpoint: "#{issuer}/oauth/authorize",
    token_endpoint: "#{issuer}/oauth/token",
    registration_endpoint: "#{issuer}/oauth/register",
    response_types_supported: %w[ code ],
    grant_types_supported: %w[ authorization_code refresh_token ],
    token_endpoint_auth_methods_supported: %w[ none ],
    code_challenge_methods_supported: %w[ S256 ],
    scopes_supported: Scope::SUPPORTED
  }
end

#protected_resourceObject



4
5
6
7
8
9
10
11
# File 'app/controllers/iron/oauth/metadata_controller.rb', line 4

def protected_resource
  render json: {
    resource: mcp_resource_url,
    authorization_servers: [ issuer ],
    bearer_methods_supported: %w[ header ],
    scopes_supported: Scope::SUPPORTED
  }
end