epierce/cas-server-extension-token — pull request #14 by jsumners (2013-07-26 14:04:02+00:00)
Title: Adds two new features: optional/required attributes and attribute mappin...

...g

Both of the features complement each other. Thus the single pull request.

The first feature adds the ability to define which attributes are
required in the `credentials` object of the encrypted JSON. This has
the side effect of also allowing any attributes to be passed in via
the `credentials` object such that those attributes will be available
to the CAS attribute repository (as they are named in the `credentials`
object). This resolves bug #1.

The second feature adds the ability to map property names of the
`credentials` object to the properties of a TokenAttributes instance.
Thus, the `credentials` object could have a property named
"sAMAccountName" and this feature can be used to map that to the
"username" property of the TokenAttributes instance for the request.
The only time this mapping is required is when the username property
is renamed.

When implementing this add-on I discovered that I could not map the
attributes for services using this add-on to the properties we use
from our primary authentication source (Active Directory). So this
is my solution to that problem.

Note, this changes the point at which your "ProviderName" ("UsfNetId")
would be added to the attributes list. If this patch is accepted, you
would have to add that attribute in the JSON you send to the CAS server.