Changelog
Version 2.0.0
- Updated all dependencies.
- More robust error handling. A proper XML parser is now used. Additionally, both the error code and error message are now passed to Überauth (see below).
- Extract all user attributes. The
emailandrolesfields are replaced by a fieldattributes. This field contains all attributes from the response. - More fields are extracted into the Überauth Info struct. By default, the strategy will insert
attributes with the same name (e.g.
cas:locationwill be inserted intolocation). This is configurable (see docs).
Upgrading from previous versions
There are some small incompatibilities in version 2.
There are now more error keys. For example, following response:
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> <cas:authenticationFailure code="INVALID_TICKET">Ticket 'ST-XXXXX' already consumed</cas:authenticationFailure> </cas:serviceResponse>used to result in
{"error", "INVALID_TICKET"}. This will now result in{"INVALID_TICKET", "Ticket 'ST-XXXXX' already consumed"}. Similarly, there is now a separate error code for malformed XML responses. You should be prepared to handle unknown error keys, since they come from the server.The raw user struct has changed. The fields
emailandroleshave been removed. They can now be found in the newattributesfield, which is a map of all attributes.The
emailno longer defaults to the username, but acas:emailattribute. You can configure which attribute is used, see the docs.The
rolesfield was removed. This didn't actually do anything in the previous version, as it was always the same value.
Note that while not supported in the previous version, parsing attributes as json or yaml is still not supported. Since this doesn't appear to be in the spec, it probably won't be supported. You can always read the field from the attributes and parse it yourself.