Class ScopeUtil
- java.lang.Object
-
- net.shibboleth.idp.plugin.oidc.op.profile.ScopeUtil
-
public final class ScopeUtil extends Object
Static helper methods for handlingScopeobjects, especially with IdP attributes.- Since:
- 3.2.0
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Modifier Constructor Description privateScopeUtil()Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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 ResolutionExceptionAdds 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
@Nonnull public static com.nimbusds.oauth2.sdk.Scope buildScope(@Nullable IdPAttribute attribute)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
public static void removeValue(@Nonnull com.nimbusds.oauth2.sdk.Scope scope, @Nonnull String value)Removes a single value from the givenScope.- Parameters:
scope- The scope to modifyvalue- The value to be removed if it exists
-
-