Sha256: f3c87295efbf539f2b127d6011ab2253d5b9c18fd3c0514a0a3b3a6ce26fe3b0
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Doorkeeper module OAuth class ClientCredentialsRequest < BaseRequest class Issuer attr_accessor :token, :validation, :error def initialize(server, validation) @server = server @validation = validation end def create(client, scopes, creator = Creator.new) if validation.valid? @token = create_token(client, scopes, creator) @error = :server_error unless @token else @token = false @error = validation.error end @token end private def create_token(client, scopes, creator) context = Authorization::Token.build_context( client, Doorkeeper::OAuth::CLIENT_CREDENTIALS, scopes ) ttl = Authorization::Token.access_token_expires_in(@server, context) creator.call( client, scopes, use_refresh_token: false, expires_in: ttl ) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems