module Doorkeeper::AccessGrantMixin::ClassMethods
def by_token(token)
-
(Doorkeeper::AccessGrant, nil)
- AccessGrant object or nil
Parameters:
-
token
(#to_s
) -- token value (any object that responds to `#to_s`)
def by_token(token) find_by_plaintext_token(:token, token) end
def fallback_secret_strategy
Determine the fallback storing strategy
#
def fallback_secret_strategy ::Doorkeeper.configuration.token_secret_fallback_strategy end
def generate_code_challenge(code_verifier)
-
(#to_s)
- An encoded code challenge based on the provided verifier
Parameters:
-
code_verifier
(#to_s
) -- a one time use value (any object that responds to `#to_s`)
def generate_code_challenge(code_verifier) padded_result = Base64.urlsafe_encode64(Digest::SHA256.digest(code_verifier)) padded_result.split("=")[0] # Remove any trailing '=' end
def pkce_supported?
def pkce_supported? new.pkce_supported? end
def revoke_all_for(application_id, resource_owner, clock = Time)
-
resource_owner
(ActiveRecord::Base
) -- -
application_id
(Integer
) --
def revoke_all_for(application_id, resource_owner, clock = Time) where(application_id: application_id, resource_owner_id: resource_owner.id, revoked_at: nil) .update_all(revoked_at: clock.now.utc) end
def secret_strategy
Determines the secret storing transformer
#
def secret_strategy ::Doorkeeper.configuration.token_secret_strategy end