Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The predicate bean named shibboleth.Conditions.SubjectName is another example of an "adapter" and allows a bean of type Predicate<String> to be applied in any situation that would normally expect a Predicate<ProfileRequestContext> and supplies as input the name of the authenticated subject associated with a request (if any).

...

  1. With an argument named pred, which is an actual Predicate<String> to run

  2. With an argument named collection, of type Collection<String>, which auto-constructs a condition that checks for the input value in the supplied collection.

...

The example below builds a condition that checks for one of a pair of usernames. The constructor argument is a Spring Expression containing a quoted list of strings. A longer list would probably be easier to supply using a more explicit Spring collection element such as <list>

Code Block
<bean id="CheckForUser" parent="shibboleth.Conditions.SubjectName" c:collection="#{{'jdoe', 'bsmith'}}"/>