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.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_policy": {
"openid_provider": {
"issuer": {"value": "https://ntnu.no"},
"organization_name": {"value": "NTNU"},
"id_token_signing_alg_values_supported":
{"subset_of": ["RS256", "RS384", "RS512"]},
"op_policy_uri": {
"regexp": "^https:\/\/[\w-]+\.example\.com\/[\w-]+\.html"}
},
"openid_relying_party": {
"organization_name": {"value": "NTNU"},
"grant_types_supported": {
"subset_of": ["authorization_code", "implicit"]},
"scopes": {
"subset_of": ["openid", "profile", "email", "phone"]}
}
},
"constraints": {
"max_path_length": 2
}
"jwks": {
"keys": [
{
"alg": "RS256",
"e": "AQAB",
"ext": true,
"key_ops": ["verify"],
"kid": "key1",
"kty": "RSA",
"n": "pnXBOusEANuug6ewezb9J_...",
"use": "sig"
}
]
},
"authority_hints": [
"https://edugain.org/federation"
]
}
Related specifications:
- OpenID Connect Federation 1.0, section 2.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 expiration time claim name.static final StringThe JWK set claim name.static final StringThe metadata 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.Fields 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 OAuth 2.0 authorisation server metadata if present for this entity.Gets 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.Gets the entity statement expiration time.Gets the federation entity metadata if present for this entity.Returns the issuer as entity ID.com.nimbusds.jose.jwk.JWKSetGets the entity JWK set.net.minidev.json.JSONObjectGets the metadata for the specified type.Gets the metadata policy for the specified type.net.minidev.json.JSONObjectGets the complete metadata policy JSON object.Gets the OAuth 2.0 client metadata if present for this entity.Gets the OpenID provider metadata if present for this entity.Gets the OpenID relying party metadata if present for this entity.Returns the subject as entity ID.Gets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0.booleanReturnstrueif a metadata field is present.booleanReturnstrueif this is a self-statement (issuer and subject match).voidsetASMetadata(AuthorizationServerMetadata asMetadata) Sets the OAuth 2.0 authorisation server metadata if present for this entity.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.voidsetFederationEntityMetadata(FederationEntityMetadata entityMetadata) Sets the federation entity metadata if present for this entity.voidsetMetadata(FederationMetadataType type, net.minidev.json.JSONObject metadata) Sets the metadata for the specified type.voidsetMetadataPolicy(FederationMetadataType type, MetadataPolicy metadataPolicy) Sets the metadata policy for the specified type.voidsetMetadataPolicyJSONObject(net.minidev.json.JSONObject metadataPolicy) Sets the complete metadata policy JSON object.voidsetOAuthClientMetadata(ClientMetadata clientMetadata) Sets the OAuth 2.0 client metadata if present for this entity.voidsetOPMetadata(OIDCProviderMetadata opMetadata) Gets the OpenID provider metadata if present for this entity.voidsetRPMetadata(OIDCClientMetadata rpMetadata) Sets the OpenID relying party metadata if present for this entity.voidsetTrustAnchorID(EntityID trustAnchorID) Sets the used trust anchor in a explicit client registration in OpenID Connect Federation 1.0.voidValidates this claims set for having all minimum required claims for an entity statement.Methods inherited from class com.nimbusds.openid.connect.sdk.claims.CommonClaimsSet
getIssueTime, getStandardClaimNames, getSubjectMethods inherited from class com.nimbusds.openid.connect.sdk.claims.ClaimsSet
equals, getAudience, getBooleanClaim, getClaim, getClaim, getDateClaim, getIssuer, getJSONObjectClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, hashCode, putAll, putAll, setAudience, setAudience, setClaim, setClaim, setDateClaim, setIssuer, setURIClaim, setURLClaim, toJSONObject, toJSONString, toJWTClaimsSet
-
Field Details
-
EXP_CLAIM_NAME
The expiration time claim name.- See Also:
-
JWKS_CLAIM_NAME
The JWK set claim name.- See Also:
-
AUTHORITY_HINTS_CLAIM_NAME
The authority hints claim name.- See Also:
-
METADATA_CLAIM_NAME
The metadata 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:
-
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
-
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.- 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.
-
getIssuerEntityID
Returns the issuer as entity ID.- Returns:
- The issuer as entity ID.
-
getSubjectEntityID
Returns the subject as entity ID.- Returns:
- The subject as entity ID.
-
getExpirationTime
Gets the entity statement expiration time. Corresponds to theexpclaim.- Returns:
- The expiration time,
nullif not specified or parsing failed.
-
getJWKSet
Gets the entity JWK set.- Returns:
- The entity JWK set,
nullif not specified or parsing failed.
-
getAuthorityHints
Gets the entity IDs of the intermediate entities or trust anchors.- 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.- Parameters:
trustChain- The entity IDs,nullor empty list for a trust anchor.
-
hasMetadata
Returnstrueif a metadata field is present.- Returns:
trueif for a metadata field for an OpenID relying party, OpenID provider, OAuth authorisation server, OAuth client, OAuth protected resource or a federation entity is present.
-
getMetadata
Gets the metadata for the specified type. Use a typed getter, such asgetRPMetadata(), when available.- Parameters:
type- The type. Must not benull.- Returns:
- The metadata,
nullif not specified.
-
setMetadata
Sets the metadata for the specified type. Use a typed setter, such assetRPMetadata(com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata), when available.- Parameters:
type- The type. Must not benull.metadata- The metadata,nullif not specified.
-
getRPMetadata
Gets the OpenID relying party metadata if present for this entity.- Returns:
- The RP metadata,
nullif not specified or if parsing failed.
-
setRPMetadata
Sets the OpenID relying party metadata if present for this entity.- Parameters:
rpMetadata- The RP metadata,nullif not specified.
-
getOPMetadata
Gets the OpenID provider metadata if present for this entity.- Returns:
- The OP metadata,
nullif not specified or if parsing failed.
-
setOPMetadata
Gets the OpenID provider metadata if present for this entity.- Parameters:
opMetadata- The OP metadata,nullif not specified.
-
getOAuthClientMetadata
Gets the OAuth 2.0 client metadata if present for this entity.- Returns:
- The client metadata,
nullif not specified or if parsing failed.
-
setOAuthClientMetadata
Sets the OAuth 2.0 client metadata if present for this entity.- Parameters:
clientMetadata- The client metadata,nullif not specified.
-
getASMetadata
Gets the OAuth 2.0 authorisation server metadata if present for this entity.- Returns:
- The AS metadata,
nullif not specified or if parsing failed.
-
setASMetadata
Sets the OAuth 2.0 authorisation server metadata if present for this entity.- Parameters:
asMetadata- The AS metadata,nullif not specified.
-
getFederationEntityMetadata
Gets the federation entity metadata if present for this entity.- Returns:
- The federation entity metadata,
nullif not specified or if parsing failed.
-
setFederationEntityMetadata
Sets the federation entity metadata if present for this entity.- Parameters:
entityMetadata- The federation entity metadata,nullif not specified.
-
getMetadataPolicyJSONObject
Gets the complete metadata policy JSON object.- Returns:
- The metadata policy JSON object,
nullif not specified or if parsing failed.
-
setMetadataPolicyJSONObject
Sets the complete metadata policy JSON object.- Parameters:
metadataPolicy- The metadata policy JSON object,nullif not specified.
-
getMetadataPolicy
public MetadataPolicy getMetadataPolicy(FederationMetadataType type) throws PolicyViolationException Gets the metadata policy for the specified type.- Parameters:
type- The 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.- Parameters:
type- The 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_idclient metadata field.- 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_idclient metadata field.- Parameters:
trustAnchorID- The trust anchor ID,nullif not specified.
-
getConstraints
Gets the trust chain constraints for subordinate entities.- Returns:
- The trust chain constraints,
nullif not specified or if parsing failed.
-
setConstraints
Sets the trust chain constraint for subordinate entities.- Parameters:
constraints- The trust chain constraints,nullif not specified.
-
getCriticalExtensionClaims
Gets the names of the critical extension claims.- Returns:
- The names of the critical extension claims,
nullif not specified or if parsing failed.
-
setCriticalExtensionClaims
Sets the names of the critical extension claims.- 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.- Returns:
- The names of the critical policy extensions or if parsing failed.
-
setCriticalPolicyExtensions
Sets the names of the critical policy extensions.- Parameters:
extNames- The names of the critical policy extensions,nullif not specified. Must not be an empty list.
-