Fediz Architecture

This page describes the security architecture for WS-Federation and the message flow between the components in detail.
The scope of Fediz is illustrated in the next section.

WS-Federation Design

The following picture illustrates the main components of a Web Single Sign On (SSO) solution based on WS-Federation (Passive Requestor Profile). The Web Application is part of the Relying Party (RP) side whereas the Identity Provider (IDP/STS) is the central security server that is responsible to authenticate clients and issue security tokens based on the requirements by the RP.
The IDP component leverages the STS capabilities to issue all sorts of security tokens.
An browser first access the Web Application (RP) which redirects the browser to the IDP as the requestor is not authenticated. The IDP authenticates the user and requests a security token based on the requirements by the RP. The security token is "redirected" to the RP which validates the token and creates a session in the RP.

Fediz provides the following components to implement Web SSO based on WS-Federation (red background):

  • Federation Plugin for RP
    The plugin consists of two Fediz libraries. The core processing logic is within a container independent library. In addition, a library is provided for each container to adapt the core library to the container specific security API.
  • IDP / STS
    The IDP / STS leverages the Apache CXF STS. Fediz ships a fully configured STS where users/claims are managed in files. The STS can be configured to integrate an LDAP directory.
  • Examples
    Fediz ships examples to illustrate how to protect a web application.

WS-Federation Message flow

This section describes and illustrates the message flow between the browser and the application and IDP in more detail.

The browser accesses the web application (1). It is then redirected to IDP/STS if no token or cookie is supplied in the request (2). This redirection process may require prompting the user (3) to authenticate himself (4). The IDP/STS issues a signed SAML 2.0 security token (WS-Federation doesn’t mandate SAML). The IDP "redirects" (5/6) the user to the application server including the SAML token. The application server verifies the signature of the SAML token. There is a trust relationship between the application server and the IDP/STS which doesn't require network connectivity between the application server and the IDP/STS (Cloud!). After successful validation, a session is created and the corresponding cookie is set on the browser (7). Finally, the request is dispatched to the application.

As an extension to the description above, step 2 might contain specific claims requested by the application such as role, username, full name, email address, sales organization, etc. which are gathered by the STS.

Requirements of the Web Application are described in the WS-Federation Metadata document.

Components

WS-Trust Security Token Service (STS)

The WS-Trust OASIS standard specifies a runtime component called Security Token Service. A service consumer requests a security token from the STS which is sent to the service provider. Either the service provider can validate the security token on its own or sends a request to the STS for validation. This pattern is based on an indirect trust relationship between the service provider and the STS instead of a direct trust between the service provider and service consumer. As long as the service consumer is in the possession of a security token issued by a trusted STS, the service provider accepts this security token.

A key benefit of the STS is the reduced complexity for applications. A web service consumer doesn't have to know how to create the various types of security tokens its service providers require. Instead, it sends a request to the STS containing the requirements of the client and the service provider and attaches the returned security token to the outgoing SOAP message to the service provider.
One service provider could require a SAML 1.1 token, another SAML 2.0 token and another custom binary security token. The service consumer doesn't have to understand SAML 1.1, SAML 2.0 or the custom binary security token. All he has to do is grab the returned token from the STS and attach it to the message. Thus, you can reduce the complexity in your application and move it to a centralized component.
A web service consumer requests tokens from an STS if the service provider defines an IssuedToken assertion in its security policy. This policy can contain some additional information like the address of the STS, token type, claims, etc.

Identity provider (IDP)

The security model of the STS builds on the foundation established by WS-Security and WS-Trust. The primary issue for Web browsers is that there is no easy way to directly send web service (SOAP) requests. Consequently, the processing must be performed within the confines of the base HTTP 1.1 functionality (GET, POST, redirects, and cookies) and conform as closely as possible to the WS-Trust protocols for token acquisition.
The IDP is in charge of transforming the SignIn request of the browser to a SOAP request for the STS and the response of the STS to the SignInResponse for the browser. Further the browser user must authenticate himself with the IDP. At the time of initial authentication an artifact/cookie may be created for the browser so that every request for a resource doesn't require user interaction.

Claims based Access Control

A claim is a statement made about a client. The concept of claim is described in the WS-Trust specification. Claims information of an authenticated subject can be carried in a Attribute Statement of a SAML token even WS-Trust doesn't mandate the usage of SAML token to carry this information.
Role based Access Control (RBAC) is a subet of Claims based Access Control. The roles of a user/subject is just a claim statement.