Static Principal Id

Returns a static, hardcoded value for the username attribute. Values can use the Spring Expression Language syntax.

1
2
3
4
5
6
7
8
9
10
{
  "@class" : "org.apereo.cas.services.CasRegisteredService",
  "serviceId" : "sample",
  "name" : "sample",
  "id" : 100,
  "usernameAttributeProvider" : {
    "@class" : "org.apereo.cas.services.StaticRegisteredServiceUsernameProvider",
    "value": "always-static-username"
  }
}

You may be able to carry out the same task with Groovy, though this option here is slightly more efficient performance-wise.