Stable5 shibboleth refactor

Refactored version of the shibboleth changes.