Hi all,
As I announced in another post, at SURFnet we have created an additional way of authorizing users in Edukapp: by using Shibboleth as a SAML SP in an Apache httpd module.
This functions as follows:
* all requests to Edukapp are processed by a servlet filter
* this filter requires a user-identifying request header being present
* - if not present, redirect to Shibboleth to let the user authenticate
* - if present, authorize this user against the local (edukapp) user store, optionally applying roles etc.
For now, these limitations apply:
- Useraccounts have to be present in Edukapp before authentication (provisioned upfront), they are not created dynamically
- Users do not get any roles assigned; it seems there is no real role based authorization set up, only a roles table which is empty.
- All requests are checked for authentication right now. There is no distinction between public pages and protected pages.
Refer to the patch attached. This configures a (disabled) servlet filter along with a Shiro Security Realm that together do the work.
The patch can be applied without affecting the current authorization setup.
It also contains the unit tests for the new classes.
To test this locally (I presume one does not have a Shibboleth instance running locally):
* enable the shibbolethFilter in web.xml (it is commented out by default, refer to the prepended security warning in web.xml)
(When running Shibboleth, this request triggers the Shibboleth module to start the authentication (probably redirecting to a WAYF etc.
For now, presume that Shibboleth completes authentication and sets a REMOTE_USER-header on the request)
* Now, configure your browser to send a custom header for every request (using an addon like 'Modify Headers' [1] for Firefox, or 'Header Hacker' [2] for Chrome): let it send:
REMOTE_USER: geert
(substitute geert for a username that is present in the useraccounts table)
* See that 'geert' is logged in now.
So this is the flow that normally happens when having Shibboleth running. It fakes the parts that Shibboleth typically performs:
- processing the /Shibboleth.sso/Login request
- setting a REMOTE_USER header on the request when returning to the application after having authenticated the user.
Let me know what you think of this.
Kind regards,
Geert