Sha256: b1f9e4c07ccc155ac3a93710a08c7afccb75fa63956c3b43bab60f9fe10ee5d6
Contents?: true
Size: 1.67 KB
Versions: 8
Compression:
Stored size: 1.67 KB
Contents
module CognitoTokenVerifier class Error < StandardError; end class ConfigSetupError < StandardError def initialize(config) @aws_region = config.aws_region @user_pool_id = config.user_pool_id end def message "Configuration of CognitoTokenVerifier is incomplete: please verify aws_region (#{@aws_region}) and Cognito user_pool_id (#{@user_pool_id})." end end class JWKFetchError < StandardError def message "Error fetching JWKs for your Cognito user pool. Please verify your configuration of the CognitoTokenVerifier gem." end end class TokenMissing < CognitoTokenVerifier::Error def message "Cognito token not provided. Please retransmit request with Cognito token in authorization header." end end class TokenDecodingError < CognitoTokenVerifier::Error def message "Cognito token could not be decoded. Please ensure the request token is from the correct Cognito user pool and try again." end end class TokenExpired < StandardError def message "Cognito token has expired. Please reauthorize and try again." end end class IncorrectTokenType < CognitoTokenVerifier::Error def initialize(token) @token_use = token.decoded_token['token_use'] end def message "Incorrect token type. Received #{@token_use} while expecting one of #{[CognitoTokenVerifier.config.token_use].flatten}." end end class InvalidIss < CognitoTokenVerifier::Error def initialize(token) @iss = token.decoded_token['iss'] end def message "Invalid token ISS reference. Received #{@iss} while expecting #{CognitoTokenVerifier.config.iss}." end end end
Version data entries
8 entries across 8 versions & 1 rubygems