module JwtClaims::Claim::Aud
Audience @see tools.ietf.org/html/rfc7519#section-4.1.3
Public Instance Methods
present_and_member?(collection, value)
click to toggle source
# File lib/jwt_claims/claim/aud.rb, line 20 def present_and_member?(collection, value) StringOrUri.present?(value) && collection.include?(value) end
reject?(aud, options = {})
click to toggle source
@param aud [Array, String] the intended recipients of the JWT @param options [Hash] (key aud:) expected audience (or recipient) to match with claim @return [true, false] whether to reject the claim
# File lib/jwt_claims/claim/aud.rb, line 14 def reject?(aud, options = {}) audience = aud.is_a?(Array) ? aud : [aud] expected_recipient = options.fetch(:aud, nil) !present_and_member?(audience, expected_recipient) end