protected static String getElement ( JWTPayload payload , String element ) { String output = null ; if ( payload != null ) { Object outObj = payload . get ( element ) ; if ( outObj instanceof String ) { output = ( String ) outObj ; } else if ( outObj instanceof List ) { if ( ( ( List < String > ) outObj ) . size ( ) == 1 ) { output = ( ( List < String > ) outObj ) . get ( 0 ) ; } // if there are multiple values, return null. } } return output ; }
Get Aud element .