Sha256: 2f4fd538b925432cb291a3dc2e4ad756dfbc196d08aa508633830952da235495

Contents?: true

Size: 545 Bytes

Versions: 9

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module Rodauth
  Feature.define(:oauth_resource_server, :OauthResourceServer) do
    def authorization_token
      return @authorization_token if defined?(@authorization_token)

      # check if there is a token
      bearer_token = fetch_access_token

      return unless bearer_token

      # where in resource server, NOT the authorization server.
      payload = introspection_request("access_token", bearer_token)

      return unless payload["active"]

      @authorization_token = payload
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rodauth-oauth-0.10.3 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.10.2 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.10.1 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.10.0 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.9.3 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.9.2 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.9.1 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.9.0 lib/rodauth/features/oauth_resource_server.rb
rodauth-oauth-0.8.0 lib/rodauth/features/oauth_resource_server.rb