Class ScopeUtil
java.lang.Object
net.shibboleth.idp.plugin.oidc.op.profile.ScopeUtil
Static helper methods for handling
Scope objects, especially with IdP attributes.- Since:
- 3.2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IdPAttributebuildAttribute(String attributeId, com.nimbusds.oauth2.sdk.Scope scope) Builds anIdPAttributewith given identifier and contents taken from the given scope.static com.nimbusds.oauth2.sdk.ScopebuildIntersectedScope(IdPAttribute attribute, com.nimbusds.oauth2.sdk.Scope scope) static com.nimbusds.oauth2.sdk.ScopebuildIntersectedScope(ScriptedIdPAttribute attribute, com.nimbusds.oauth2.sdk.Scope scope) static com.nimbusds.oauth2.sdk.ScopebuildScope(IdPAttribute attribute) BuildsScopefrom the given attribute contents.static com.nimbusds.oauth2.sdk.ScopebuildScope(ScriptedIdPAttribute attribute) BuildsScopefrom the givenScriptedIdPAttribute.static voidpopulateScriptedAttribute(ScriptedIdPAttribute attribute, com.nimbusds.oauth2.sdk.Scope scope) Adds values from the given scope to theScriptedIdPAttribute.static voidpopulateScriptedAttribute(ScriptedIdPAttribute attribute, ScriptedIdPAttribute source) Adds values from the givenScriptedIdPAttributeto anotherScriptedIdPAttribute.static voidremoveValue(com.nimbusds.oauth2.sdk.Scope scope, String value) Removes a single value from the givenScope.static voidsetAttributeValues(IdPAttribute attribute, com.nimbusds.oauth2.sdk.Scope scope) Sets the contents forIdPAttributefrom the given scope.
-
Field Details
-
log
private static org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
ScopeUtil
private ScopeUtil()Private constructor.
-
-
Method Details
-
buildAttribute
@Nonnull public static IdPAttribute buildAttribute(@Nonnull String attributeId, @Nullable com.nimbusds.oauth2.sdk.Scope scope) Builds anIdPAttributewith given identifier and contents taken from the given scope.- Parameters:
attributeId- The attribute ID to usescope- The contents for the attribute- Returns:
- The built attribute
-
setAttributeValues
public static void setAttributeValues(@Nonnull IdPAttribute attribute, @Nullable com.nimbusds.oauth2.sdk.Scope scope) Sets the contents forIdPAttributefrom the given scope.- Parameters:
attribute- The attribute whose contents are setscope- The contents for the attribute
-
populateScriptedAttribute
public static void populateScriptedAttribute(@Nonnull ScriptedIdPAttribute attribute, @Nullable com.nimbusds.oauth2.sdk.Scope scope) Adds values from the given scope to theScriptedIdPAttribute.- Parameters:
attribute- The attribute whose contents are fulfilledscope- The contents to fulfill for the attribute
-
populateScriptedAttribute
public static void populateScriptedAttribute(@Nonnull ScriptedIdPAttribute attribute, @Nullable ScriptedIdPAttribute source) throws ResolutionException Adds values from the givenScriptedIdPAttributeto anotherScriptedIdPAttribute.- Parameters:
attribute- The attribute whose contents are fulfilledsource- The contents to fulfill for the attribute- Throws:
ResolutionException- If the soure attribute contents cannot be accessed
-
buildScope
BuildsScopefrom the given attribute contents. Only theStringAttributeValues are recognized.- Parameters:
attribute- The attribute whose contents are used for the scope- Returns:
- The built scope
-
buildScope
@Nonnull public static com.nimbusds.oauth2.sdk.Scope buildScope(@Nullable ScriptedIdPAttribute attribute) throws ResolutionException - Parameters:
attribute- The attribute whose contents are used for the scope- Returns:
- The built scope
- Throws:
ResolutionException- If the attribute values cannot be accessed
-
buildIntersectedScope
@Nonnull public static com.nimbusds.oauth2.sdk.Scope buildIntersectedScope(@Nullable IdPAttribute attribute, @Nullable com.nimbusds.oauth2.sdk.Scope scope) - Parameters:
attribute- The attribute whose contents are processedscope- The existing scope whose contents are processed- Returns:
- The intersection of the two contents
-
buildIntersectedScope
@Nonnull public static com.nimbusds.oauth2.sdk.Scope buildIntersectedScope(@Nullable ScriptedIdPAttribute attribute, @Nullable com.nimbusds.oauth2.sdk.Scope scope) throws ResolutionException - Parameters:
attribute- The attribute whose contents are processedscope- The existing scope whose contents are processed- Returns:
- The intersection of the two contents
- Throws:
ResolutionException- If th attribute values cannot be accessed
-
removeValue
Removes a single value from the givenScope.- Parameters:
scope- The scope to modifyvalue- The value to be removed if it exists
-