java的StringClaim⽅法代码⽰
例
import com.nimbusds.jwt.JWTClaimsSet; //导⼊⽅法依赖的package包/类杰克逊经典歌曲下载
/**
* Pars authz code from string (JSON)
*
* @param authorizeCodeClaimsSet
* JSON String reprentation of the code
* @return AuthorizeCodeClaimsSet instance if parsing is successful.四级证书
* @throws ParException
* if parsing fails for example due to incompatible types.
coca cola
*/
public static AuthorizeCodeClaimsSet par(String authorizeCodeClaimsSet) throws ParException {
JWTClaimsSet acClaimsSet = JWTClaimsSet.par(authorizeCodeClaimsSet);
// Check existence and type of mandatory fields and values
if (!VALUE_TYPE_AC.Claims().get(KEY_TYPE))) {
throw new ParException("claim type must have value ac", 0);
}
//Mandatory fields
if (StringClaim(KEY_ISSUER) == null) {
throw new ParException("claim iss must exist and not be null", 0);
}
if (StringClaim(KEY_USER_PRINCIPAL) == null) {
uccallthrow new ParException("claim sub must exist and not be null", 0);
}
if (StringArrayClaim(KEY_CLIENTID) == null) {
throw new ParException("claim aud must exist and not be null", 0);
messrs
}
if (DateClaim(KEY_EXPIRATION_TIME) == null) {广州教育
throw new ParException("claim exp must exist and not be null", 0);
}
if (DateClaim(KEY_ISSUED_AT) == null) {
throw new ParException("claim iat must exist and not be null", 0);
}
周迅大婚if (StringClaim(KEY_AC_ID) == null) {
throw new ParException("claim jti must exist and not be null", 0);
}
if (StringClaim(KEY_ACR) == null) {epidemic
throw new ParException("claim acr must exist and not be null", 0);nhk官网
}
if (DateClaim(KEY_AUTH_TIME) == null) {
throw new ParException("claim auth_time must exist and not be null", 0); }
timewarnerif (StringClaim(KEY_REDIRECT_URI) == null) {
throw new ParException("claim redirect_uri must exist and not be null", 0); }
if (StringClaim(KEY_SCOPE) == null) {
throw new ParException("claim scope must exist and not be null", 0);
}
//Voluntary fields
if (Claims().containsKey(KEY_CLAIMS)) {
}
if (Claims().containsKey(KEY_NONCE)) {
}
return new AuthorizeCodeClaimsSet(acClaimsSet);
}