code: @Override
      public Builder claimFrom(String jsonOrJwt, String claim) throws InvalidClaimException, InvalidTokenException {
          if (JwtUtils.isNullEmpty(claim)) {
              String err = Tr.formatMessage(tc, "JWT_INVALID_CLAIM_ERR", new Object[] { claim });
              throw new InvalidClaimException(err);
          }
          if (isValidToken(jsonOrJwt)) {
              String decoded = jsonOrJwt;
              if (JwtUtils.isBase64Encoded(jsonOrJwt)) {
                  decoded = JwtUtils.decodeFromBase64String(jsonOrJwt);
              }
              boolean isJson = JwtUtils.isJson(decoded);
  
              if (!isJson) {
                  String jwtPayload = JwtUtils.getPayload(jsonOrJwt);
                  decoded = JwtUtils.decodeFromBase64String(jwtPayload);
              }
  
              // } else {
              // // either decoded payload from jwt or encoded/decoded json string
              // if (JwtUtils.isBase64Encoded(jsonOrJwt)) {
              // decoded = JwtUtils.decodeFromBase64String(jsonOrJwt);
              // }
              // }
  
              if (decoded != null) {
                  Object claimValue = null;
                  try {
                      if ((claimValue = JwtUtils.claimFromJsonObject(decoded, claim)) != null) {
                          claims.put(claim, claimValue);
                      }
                  } catch (JoseException e) {
                      String err = Tr.formatMessage(tc, "JWT_INVALID_TOKEN_ERR");
                      throw new InvalidTokenException(err);
                  }
              }
          }
  
          return this;
      }
docs: /*
  (non-Javadoc)
  
  @see com.ibm.ws.security.jwt.internal.Builder#claimFrom(java.lang.String, java.lang.String)