class Doorkeeper::OAuth::ClientCredentials::Issuer
def create(client, scopes, attributes = {}, creator = Creator.new)
def create(client, scopes, attributes = {}, creator = Creator.new) if validator.valid? @token = create_token(client, scopes, attributes, creator) @error = Errors::ServerError unless @token else @token = false @error = validator.error end @token end
def create_token(client, scopes, attributes, creator)
def create_token(client, scopes, attributes, creator) context = Authorization::Token.build_context( client, Doorkeeper::OAuth::CLIENT_CREDENTIALS, scopes, nil, ) ttl = Authorization::Token.access_token_expires_in(@server, context) creator.call( client, scopes, use_refresh_token: false, expires_in: ttl, **attributes ) end
def initialize(server, validator)
def initialize(server, validator) @server = server @validator = validator end