Class EntityStatementClaimsSet
java.lang.Object
com.nimbusds.openid.connect.sdk.claims.ClaimsSet
com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
com.nimbusds.openid.connect.sdk.federation.entities.CommonFederationClaimsSet
com.nimbusds.openid.connect.sdk.federation.entities.EntityStatementClaimsSet
- All Implemented Interfaces:
net.minidev.json.JSONAware
Federation entity statement claims set, serialisable to a JSON object.
Example claims set:
{
"iss": "https://feide.no",
"sub": "https://ntnu.no",
"iat": 1516239022,
"exp": 1516298022,
"crit": ["jti"],
"jti": "7l2lncFdY6SlhNia",
"policy_language_crit": ["regexp"],
"metadata": {
"openid_provider": {
"issuer": "https://ntnu.no",
"organization_name": "NTNU",
},
"oauth_client": {
"organization_name": "NTNU"
}
},
"metadata_policy": {
"openid_provider": {
"id_token_signing_alg_values_supported": {
"subset_of": ["RS256", "RS384", "RS512"]
},
"op_policy_uri": {
"regexp": "^https:\/\/[\\w-]+\\.example\\.com\/[\\w-]+\\.html"}
},
"oauth_client": {
"grant_types": {
"subset_of": ["authorization_code", "client_credentials"]},
"scope": {
"subset_of": ["openid", "profile", "email", "phone"]}
}
},
"constraints": {
"max_path_length": 2
},
"jwks": {
"keys": [
{
"alg": "RS256",
"e": "AQAB",
"key_ops": ["verify"],
"kid": "key1",
"kty": "RSA",
"n": "pnXBOusEANuug6ewezb9J_...",
"use": "sig"
}
]
}
}
Related specifications:
- OpenID Connect Federation 1.0, section 3.1.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe authority hints claim name.static final StringThe constraints claim name.static final StringThe critical claim name.static final StringThe JWK set claim name.static final StringThe metadata policy claim name.static final StringThe policy critical claim name.static final StringThe assumed trust anchor in a explicit client registration.static final StringThe trust marks issuers claim name.Fields inherited from class com.nimbusds.openid.connect.sdk.federation.entities.CommonFederationClaimsSet
EXP_CLAIM_NAME, METADATA_CLAIM_NAME, TRUST_MARKS_CLAIM_NAMEFields inherited from class com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
IAT_CLAIM_NAME, SUB_CLAIM_NAMEFields inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
AUD_CLAIM_NAME, claims, ISS_CLAIM_NAME -
Constructor Summary
ConstructorsConstructorDescriptionEntityStatementClaimsSet(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) Creates a new federation entity statement claims set from the specified JWT claims set.EntityStatementClaimsSet(Issuer iss, Subject sub, Date iat, Date exp, com.nimbusds.jose.jwk.JWKSet jwks) Creates a new federation entity statement claims set with the minimum required claims.EntityStatementClaimsSet(EntityID iss, EntityID sub, Date iat, Date exp, com.nimbusds.jose.jwk.JWKSet jwks) Creates a new federation entity statement claims set with the minimum required claims. -
Method Summary
Modifier and TypeMethodDescriptionGets the entity IDs of the intermediate entities or trust anchors.Gets the trust chain constraints for subordinate entities.Gets the names of the critical extension claims.Gets the names of the critical policy extensions.com.nimbusds.jose.jwk.JWKSetGets the entity JWK set.getMetadataPolicy(EntityType type) Gets the metadata policy for the specified type.net.minidev.json.JSONObjectGets the complete metadata policy JSON object.Gets the OpenID relying party information (metadata plusclient_idand potentially other client information fields) if present for this entity.Gets the names of the standard top-level claims.Gets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0.Gets the trust marks issuers.booleanReturnstrueif a metadata field is present.booleanReturnstrueif this is a self-statement (issuer and subject match).voidsetAuthorityHints(List<EntityID> trustChain) Sets the entity IDs of the intermediate entities or trust anchors.voidsetConstraints(TrustChainConstraints constraints) Sets the trust chain constraint for subordinate entities.voidsetCriticalExtensionClaims(List<String> claimNames) Sets the names of the critical extension claims.voidsetCriticalPolicyExtensions(List<String> extNames) Sets the names of the critical policy extensions.voidsetMetadataPolicy(EntityType type, MetadataPolicy metadataPolicy) Sets the metadata policy for the specified type.voidsetMetadataPolicyJSONObject(net.minidev.json.JSONObject metadataPolicy) Sets the complete metadata policy JSON object.voidSets the OpenID relying party information (metadata plusclient_idand potentially other client information fields) if present for this entity.voidsetTrustAnchorID(EntityID trustAnchorID) Sets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0.voidsetTrustMarkIssuerMetadata(TrustMarkIssuerMetadata trustMarkIssuerMetadata) Deprecated.voidsetTrustMarks(List<TrustMarkEntry> marks) Sets the trust marks.voidsetTrustMarksIssuers(Map<Identifier, List<Issuer>> issuers) Sets the trust marks issuers.voidValidates this claims set for having all minimum required claims for an entity statement.Methods inherited from class com.nimbusds.openid.connect.sdk.federation.entities.CommonFederationClaimsSet
getASMetadata, getExpirationTime, getFederationEntityMetadata, getIssuerEntityID, getMetadata, getOAuthClientMetadata, getOPMetadata, getRPMetadata, getSubjectEntityID, getTrustMarkIssuerMetadata, getTrustMarks, setASMetadata, setFederationEntityMetadata, setMetadata, setOAuthClientMetadata, setOPMetadata, setRPMetadataMethods inherited from class com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
getIssueTime, getSubjectMethods inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
equals, getAudience, getBooleanClaim, getClaim, getClaim, getDateClaim, getIssuer, getJSONArrayClaim, getJSONObjectClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, hashCode, putAll, putAll, setAudience, setAudience, setClaim, setClaim, setDateClaim, setIssuer, setURIClaim, setURLClaim, toJSONObject, toJSONString, toJWTClaimsSet, toString
-
Field Details
-
JWKS_CLAIM_NAME
The JWK set claim name.- See Also:
-
AUTHORITY_HINTS_CLAIM_NAME
The authority hints claim name.- See Also:
-
METADATA_POLICY_CLAIM_NAME
The metadata policy claim name.- See Also:
-
TRUST_ANCHOR_ID_CLAIM_NAME
The assumed trust anchor in a explicit client registration. Intended for entity statements issued by an OP for RP performing explicit client registration only.- See Also:
-
CONSTRAINTS_CLAIM_NAME
The constraints claim name.- See Also:
-
TRUST_MARKS_ISSUERS_CLAIM_NAME
The trust marks issuers claim name.- See Also:
-
CRITICAL_CLAIM_NAME
The critical claim name.- See Also:
-
POLICY_LANGUAGE_CRITICAL_CLAIM_NAME
The policy critical claim name.- See Also:
-
-
Constructor Details
-
EntityStatementClaimsSet
public EntityStatementClaimsSet(Issuer iss, Subject sub, Date iat, Date exp, com.nimbusds.jose.jwk.JWKSet jwks) Creates a new federation entity statement claims set with the minimum required claims.- Parameters:
iss- The issuer. Must not benull.sub- The subject. Must not benull.iat- The issue time. Must not benull.exp- The expiration time. Must not benull.jwks- The entity public JWK set,nullif not required.
-
EntityStatementClaimsSet
public EntityStatementClaimsSet(EntityID iss, EntityID sub, Date iat, Date exp, com.nimbusds.jose.jwk.JWKSet jwks) Creates a new federation entity statement claims set with the minimum required claims.- Parameters:
iss- The issuer. Must not benull.sub- The subject. Must not benull.iat- The issue time. Must not benull.exp- The expiration time. Must not benull.jwks- The entity public JWK set,nullif not required.
-
EntityStatementClaimsSet
Creates a new federation entity statement claims set from the specified JWT claims set.- Parameters:
jwtClaimsSet- The JWT claims set. Must not benull.- Throws:
ParseException- If the JWT claims set doesn't represent a valid federation entity statement claims set.
-
-
Method Details
-
getStandardClaimNames
Gets the names of the standard top-level claims.- Returns:
- The names of the standard top-level claims (read-only set).
-
validateRequiredClaimsPresence
Validates this claims set for having all minimum required claims for an entity statement. If aselt-statementcheck for thepresence of metadata. Ifcritical extension claimsare listed their presence is also checked.- Overrides:
validateRequiredClaimsPresencein classCommonFederationClaimsSet- Throws:
ParseException- If the validation failed and a required claim is missing.
-
isSelfStatement
Returnstrueif this is a self-statement (issuer and subject match).- Returns:
truefor a self-statement,falseif not.
-
getJWKSet
Gets the entity JWK set. Corresponds to thejwksclaim.- Returns:
- The entity JWK set,
nullif not specified or parsing failed.
-
getAuthorityHints
Gets the entity IDs of the intermediate entities or trust anchors. Corresponds to theauthority_hintsclaim.- Returns:
- The entity IDs,
nullor empty list for a trust anchor, or if parsing failed.
-
setAuthorityHints
Sets the entity IDs of the intermediate entities or trust anchors. Corresponds to theauthority_hintsclaim.- Parameters:
trustChain- The entity IDs,nullor empty list for a trust anchor.
-
hasMetadata
Returnstrueif a metadata field is present. Corresponds to themetadataclaim.- Returns:
trueif a metadata field for an OpenID relying party, an OpenID provider, an OAuth authorisation server, an OAuth client, an OAuth protected resource, a federation entity, or a trust mark issuer is present.
-
getRPInformation
Gets the OpenID relying party information (metadata plusclient_idand potentially other client information fields) if present for this entity. Corresponds to themetadata.openid_relying_partyclaim.- Returns:
- The RP information,
nullif not specified or if parsing failed.
-
setRPInformation
Sets the OpenID relying party information (metadata plusclient_idand potentially other client information fields) if present for this entity. Corresponds to themetadata.openid_relying_partyclaim.- Parameters:
rpInfo- The RP information,nullif not specified or if parsing failed.
-
setTrustMarkIssuerMetadata
Deprecated.Sets the trust mark issuer metadata for this entity. Corresponds to themetadata.trust_mark_issuerclaim.- Parameters:
trustMarkIssuerMetadata- The trust mark issuer metadata,nullif not specified.
-
getMetadataPolicyJSONObject
Gets the complete metadata policy JSON object. Corresponds to themetadata_policyclaim.- Returns:
- The metadata policy JSON object,
nullif not specified or if parsing failed.
-
setMetadataPolicyJSONObject
Sets the complete metadata policy JSON object. Corresponds to themetadata_policyclaim.- Parameters:
metadataPolicy- The metadata policy JSON object,nullif not specified.
-
getMetadataPolicy
Gets the metadata policy for the specified type. Corresponds to themetadata_policyclaim.- Parameters:
type- The entity type. Must not benull.- Returns:
- The metadata policy,
nullor if JSON parsing failed. - Throws:
PolicyViolationException- On a policy violation.
-
setMetadataPolicy
Sets the metadata policy for the specified type. Corresponds to themetadata_policyclaim.- Parameters:
type- The entity type. Must not benull.metadataPolicy- The metadata policy,nullif not specified.
-
getTrustAnchorID
Gets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0. Intended for entity statements issued by an OpenID provider for a Relying party performing explicit client registration only. Corresponds to thetrust_anchor_idclaim.- Returns:
- The trust anchor ID,
nullif not specified.
-
setTrustAnchorID
Sets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0. Intended for entity statements issued by an OpenID provider for a Relying party performing explicit client registration only. Corresponds to thetrust_anchor_idclaim.- Parameters:
trustAnchorID- The trust anchor ID,nullif not specified.
-
getConstraints
Gets the trust chain constraints for subordinate entities. Corresponds to theconstraintsclaim.- Returns:
- The trust chain constraints,
nullif not specified or if parsing failed.
-
setConstraints
Sets the trust chain constraint for subordinate entities. Corresponds to theconstraintsclaim.- Parameters:
constraints- The trust chain constraints,nullif not specified.
-
setTrustMarks
Sets the trust marks. Corresponds to thetrust_marksclaim.- Overrides:
setTrustMarksin classCommonFederationClaimsSet- Parameters:
marks- The trust marks,nullif not specified.
-
getTrustMarksIssuers
Gets the trust marks issuers. Corresponds to thetrust_marks_issuersclaim.- Returns:
- The trust marks issuers,
nullif not specified or parsing failed.
-
setTrustMarksIssuers
Sets the trust marks issuers. Corresponds to thetrust_marks_issuersclaim.- Parameters:
issuers- The trust marks issuers,nullif not specified.
-
getCriticalExtensionClaims
Gets the names of the critical extension claims. Corresponds to thecritclaim.- Returns:
- The names of the critical extension claims,
nullif not specified or if parsing failed.
-
setCriticalExtensionClaims
Sets the names of the critical extension claims. Corresponds to thecritclaim.- Parameters:
claimNames- The names of the critical extension claims,nullif not specified. Must not be an empty list.
-
getCriticalPolicyExtensions
Gets the names of the critical policy extensions. Corresponds to thepolicy_language_critclaim.- Returns:
- The names of the critical policy extensions or if parsing failed.
-
setCriticalPolicyExtensions
Sets the names of the critical policy extensions. Corresponds to thepolicy_language_critclaim.- Parameters:
extNames- The names of the critical policy extensions,nullif not specified. Must not be an empty list.
-