001/*
002 * oauth2-oidc-sdk 
003 *
004 * Copyright 2012-2016, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.openid.connect.sdk.validators;
019
020
021import com.nimbusds.jwt.proc.BadJWTException;
022import net.jcip.annotations.Immutable;
023
024
025/**
026 * Common bad JWT exceptions.
027 */
028@Immutable
029public final class BadJWTExceptions {
030        
031        
032        /**
033         * Missing {@code exp} claim exception.
034         */
035        public static final BadJWTException MISSING_EXP_CLAIM_EXCEPTION =
036                new BadJWTException("Missing JWT expiration (exp) claim");
037        
038        
039        /**
040         * Missing {@code iat} claim exception.
041         */
042        public static final BadJWTException MISSING_IAT_CLAIM_EXCEPTION =
043                new BadJWTException("Missing JWT issue time (iat) claim");
044        
045        
046        /**
047         * Missing {@code iss} claim exception.
048         */
049        public static final BadJWTException MISSING_ISS_CLAIM_EXCEPTION =
050                new BadJWTException("Missing JWT issuer (iss) claim");
051        
052        
053        /**
054         * Missing {@code sub} claim exception.
055         */
056        public static final BadJWTException MISSING_SUB_CLAIM_EXCEPTION =
057                new BadJWTException("Missing JWT subject (sub) claim");
058        
059        
060        /**
061         * Missing {@code aud} claim exception.
062         */
063        public static final BadJWTException MISSING_AUD_CLAIM_EXCEPTION =
064                new BadJWTException("Missing JWT audience (aud) claim");
065        
066        
067        /**
068         * Missing {@code nonce} claim exception.
069         */
070        public static final BadJWTException MISSING_NONCE_CLAIM_EXCEPTION =
071                new BadJWTException("Missing JWT nonce (nonce) claim");
072        
073        
074        /**
075         * Expired ID token exception.
076         */
077        public static final BadJWTException EXPIRED_EXCEPTION =
078                new BadJWTException("Expired JWT");
079        
080        
081        /**
082         * ID token issue time ahead of current time exception.
083         */
084        public static final BadJWTException IAT_CLAIM_AHEAD_EXCEPTION =
085                new BadJWTException("JWT issue time ahead of current time");
086        
087        
088        /**
089         * Prevents public instantiation.
090         */
091        private BadJWTExceptions() {}
092}