Sha256: 29e3a6dcf37919360aa2c7fa35e5f137c9c59bf339e0f0fa7da5e0e15a90d98a
Contents?: true
Size: 1.02 KB
Versions: 7
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Doorkeeper module OAuth class ClientCredentialsRequest < BaseRequest attr_reader :client, :original_scopes, :parameters, :response alias error_response response delegate :error, to: :issuer def initialize(server, client, parameters = {}) @client = client @server = server @response = nil @original_scopes = parameters[:scope] @parameters = parameters.except(:scope) end def access_token issuer.token end def issuer @issuer ||= ClientCredentials::Issuer.new( server, ClientCredentials::Validator.new(server, self), ) end private def valid? issuer.create(client, scopes, custom_token_attributes_with_data) end def custom_token_attributes_with_data parameters .with_indifferent_access .slice(*Doorkeeper.config.custom_access_token_attributes) .symbolize_keys end end end end
Version data entries
7 entries across 7 versions & 1 rubygems