Before I describe a more complex scenario, I'd like to summerize the benefits of the simple scenario:
- Authentication is externalized to IdP/STS
- New IdP authentication mechanism can be used by all applications
- Role Based Access control (RBAC) supported in applications
- Claims/Attrribute based acess control (ABAC) supported in applications
- IDP and applications deployable in different networks (ex. on-premise and cloud)
- Easy testing with Mock IdP
Federation with B2B partners in the internet
In most cases, a web application is built for a single user group like internal users with some basic authentication mechanism like username/password against an LDAP system. Over time, the business see some potential to grow in providing this solution to partners. The application is enhanced to support a new kind of authentication mechanism for the users of the partner. The next partner has again a different kind of approach for authentication which must be extended in your application. Very often, the userids of the partner's employees have to be managed within your ID system also. What happens of an employee of the partner leaves the company? Usually, a manual process must be triggered to deprovision the user in your ID system.
How can federation and claims based authorization help here. The simple scenario doesn't support different kind of "user groups". But it's very important to highlight that the authentication mechanism is not tight into the application but instead into the IDP component. The benefit of federation is that you can integrate new partners without having an impact on your application. Just imagine how agile your application is to generate new business with new B2B partners without building a new authentication mechanism within all your applications.
How does this work? Let's look at a concrete example.
Our federation enabled web application should be provided to two new partners (fabrikam.com and adatam.com).
The users of fabrikam.com and adatam.com are managed within their own identity store. The following list provides more context information of the companies:
- 10000 users
- five roles (user, manager, sales, accountmanager, admin)
- IDP supported
- 2000 users
- three roles (employee, manager, administrator)
- IDP supported with restrictions (SAML token contains user only)
- 50 users
- two roles (user, accountmanager)
fabrikam.com supports an IDP but can't provide the role information. mycompany.com decides to manage the 50 users and its roles within a dedicated ID store within their network (another option would have been to choose a more advanced IDM solution in the cloud). The usernames are different within the ID store at fabrikam.com and the dedicated ID store of mycompany.com due to different naming conventions in place.
The following deployment diagram illustrates the solution:
I haven't drawn any lines between the browser and the relying party which is the first component the browser accesses. The relying party redirects the browser to the RP-IDP (resource IDP) where the home realm discovery mechanism redirects the browser to its (requestor) IDP. The requestor IDP authenticates the browser and issues a SAML token with claims information. The browser sends the SAML token to the RP-IDP which transforms the SAML token into a format which can be validated and processed by the application (RP). This SAML token has the exact same structure independent who the requestor IDP was.
What happens with the different kind of syntax of the roles?
The RP-IDP transforms the roles from the requestor IDP to the internal set of roles.
- employee -> user
- manager -> manager
- administrator -> admin
How can the RP-IDP get the roles of the users?
The RP-IDP maps the userid of fabrikam.com to an internal userid in mycompany.com. The mapped userid is used to retrieve the role information. The roles/claims are not transformed.
Finally, the issued tokens by the RP-IDP have the same syntax and semantic independent whether a user from fabrikam.com, adatam.com or an internal user accesses the application.
There are different kind of relationships between mycompany.com and the partner adatam.com and fabrikam.com. The former relies on federating the claims information whereas the latter federates/maps the userid/identity.
Support for identity mapping and claims transformation in STS
The STS is the key component in the WS-Federation based solution who issues the security tokens. The CXF STS supports identity mapping in the release 2.5.x.
I've finished my work to add support for claims transformation in the CXF STS.
Soon, I'll provide more details how to configure an STS with several realms (security domains) and different federation relationships among them.