Package com.sun.identity.entitlement
Class JwtClaimSubject
- java.lang.Object
-
- com.sun.identity.entitlement.JwtClaimSubject
-
- All Implemented Interfaces:
EntitlementSubject
public class JwtClaimSubject extends Object implements EntitlementSubject
A policy subject condition that examines claims in a Json Web Token (JWT) subject, such as an OpenID Connect ID token. Currently only supports testing claims for string equality and contained in collection.
-
-
Constructor Summary
Constructors Constructor Description JwtClaimSubject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
claimMatches(org.forgerock.json.JsonValue claim, String claimValue)
boolean
equals(Object o)
SubjectDecision
evaluate(String realm, SubjectAttributesManager mgr, Subject subject, String resourceName, Map<String,Set<String>> environment)
ReturnsSubjectDecision
ofEntitlementSubject
evaluation.String
getClaimName()
String
getClaimValue()
Set<String>
getRequiredAttributeNames()
Returns a set of attribute names that are used for evaluation.Map<String,Set<String>>
getSearchIndexAttributes()
Returns attribute names and values that could be used for indexing.String
getState()
Returns state of the object encoded as a JSON string.int
hashCode()
boolean
isIdentity()
Returnstrue
is this subject is an identity object.void
setClaimName(String claim)
void
setClaimValue(String value)
void
setState(String state)
Sets state of this object from a JSON string.String
toString()
-
-
-
Method Detail
-
setState
public void setState(String state)
Description copied from interface:EntitlementSubject
Sets state of this object from a JSON string.- Specified by:
setState
in interfaceEntitlementSubject
- Parameters:
state
- State of the object encoded as a JSON string
-
getState
public String getState()
Description copied from interface:EntitlementSubject
Returns state of the object encoded as a JSON string.- Specified by:
getState
in interfaceEntitlementSubject
- Returns:
- state of the object encoded as a JSON string.
-
getSearchIndexAttributes
public Map<String,Set<String>> getSearchIndexAttributes()
Description copied from interface:EntitlementSubject
Returns attribute names and values that could be used for indexing. These values will be used by the authorization engine to obtain the applicable policies for a givenSubject .- Specified by:
getSearchIndexAttributes
in interfaceEntitlementSubject
- Returns:
- a map of key-value pairs that will be used for indexing the
entitlements that contain this
EntitlementSubject .
-
getRequiredAttributeNames
public Set<String> getRequiredAttributeNames()
Description copied from interface:EntitlementSubject
Returns a set of attribute names that are used for evaluation. During evaluation, theEvaluator would try to populate these attributes in theSubject for theEntitlementSubject 's consumption.- Specified by:
getRequiredAttributeNames
in interfaceEntitlementSubject
- Returns:
- a set of attributes that would be required by the
EntitlementSubject 's implementation.
-
evaluate
public SubjectDecision evaluate(String realm, SubjectAttributesManager mgr, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
Description copied from interface:EntitlementSubject
ReturnsSubjectDecision
ofEntitlementSubject
evaluation.- Specified by:
evaluate
in interfaceEntitlementSubject
- Parameters:
realm
- Realm name.subject
- Subject who is under evaluation.resourceName
- Resource name.environment
- Environment parameters.- Returns:
SubjectDecision
ofSubject
evaluation.- Throws:
EntitlementException
- if any errors occur.
-
claimMatches
public boolean claimMatches(org.forgerock.json.JsonValue claim, String claimValue)
-
isIdentity
public boolean isIdentity()
Description copied from interface:EntitlementSubject
Returnstrue
is this subject is an identity object.- Specified by:
isIdentity
in interfaceEntitlementSubject
- Returns:
true
is this subject is an identity object.
-
setClaimName
public void setClaimName(String claim)
-
getClaimName
public String getClaimName()
-
setClaimValue
public void setClaimValue(String value)
-
getClaimValue
public String getClaimValue()
-
-