boolean validateIssuer ( String consumerConfigId , String issuers , String tokenIssuer ) throws InvalidClaimException { boolean isIssuer = false ; if ( issuers == null || issuers . isEmpty ( ) ) { String msg = Tr . formatMessage ( tc , "JWT_TRUSTED_ISSUERS_NULL" , new Object [ ] { tokenIssuer , consumerConfigId } ) ; throw new InvalidClaimException ( msg ) ; } StringTokenizer st = new StringTokenizer ( issuers , "," ) ; while ( st . hasMoreTokens ( ) ) { String iss = st . nextToken ( ) . trim ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trusted issuer: " + iss ) ; } if ( Constants . ALL_ISSUERS . equals ( iss ) || ( tokenIssuer != null && tokenIssuer . equals ( iss ) ) ) { isIssuer = true ; break ; } } if ( ! isIssuer ) { String msg = Tr . formatMessage ( tc , "JWT_ISSUER_NOT_TRUSTED" , new Object [ ] { tokenIssuer , consumerConfigId , issuers } ) ; throw new InvalidClaimException ( msg ) ; } return isIssuer ; }
Verifies that tokenIssuer is one of the values specified in the comma - separated issuers string .