Commit eb546bd
Changed files (2)
app
controllers
models
app/controllers/clients_controller.rb
@@ -16,7 +16,10 @@ class ClientsController < ApplicationController
def transform(params)
{
name: params[:client_name],
- redirect_uri: params[:redirect_uris][0],
+ redirect_uris: params[:redirect_uris],
+ token_endpoint_auth_method: params[:token_endpoint_auth_method],
+ logo_uri: params[:logo_uri],
+ jwks_uri: params[:jwks_uri],
}
end
app/models/client.rb
@@ -6,8 +6,11 @@ class Client < ApplicationRecord
has_secure_password
has_many :authorizations
attribute :redirect_uris, :string, array: true
+ enum token_endpoint_auth_method: { client_secret_none: 0, client_secret_post: 1, client_secret_basic: 2 }
+
+ validates :jwks_uri, format: { with: URI_REGEX }
+ validates :logo_uri, format: { with: URI_REGEX }
validates :name, presence: true
- validates :redirect_uri, presence: true, format: { with: URI_REGEX }
validates :uuid, presence: true, format: { with: UUID }
after_initialize do
@@ -19,10 +22,6 @@ class Client < ApplicationRecord
[:authorization_code, :refresh_token, :client_credentials, :password, 'urn:ietf:params:oauth:grant-type:saml2-bearer']
end
- def token_endpoint_auth_method
- :client_secret_basic
- end
-
def access_token
transaction do
Token