# Federation

# Introduction to Identity Federation

## What is Identity Federation?

A **federated identity** in [information technology](https://en.wikipedia.org/wiki/Information_technology "Information technology") is the means of linking a person's [electronic identity](https://en.wikipedia.org/wiki/Digital_identity "Digital identity") and attributes, stored across multiple distinct [identity management](https://en.wikipedia.org/wiki/Identity_management "Identity management") systems. The federation is a system of trust between two parties for the purpose of authenticating users and sharing information needed to authorize their access to resources.

> A federated identity in information technology is the means of linking a person's electronic identity and attributes, stored across multiple distinct identity management systems.
> 
> It is related to single sign-on (SSO), in which a user's single authentication ticket, or token, is trusted across multiple IT systems or even organizations. SSO is a subset of federated identity management, as it relates only to authentication and is understood on the level of technical interoperability and it would not be possible without some sort of federation.

Federated identity is related to single sign-on (SSO), in which a user's single authentication ticket, or token, is trusted across multiple IT systems or even organizations. SSO is a subset of federated identity management, as it relates only to authentication and is understood on the level of technical interoperability and it would not be possible without some sort of federation.

With the identity federation, we get to separate the applications and, the login and get permissions process. Currently, there are two mainstream identity federation standards: **SAML** and **OpenID-Connect**.

The authentication service is responsible for identifying users and passing the information to the applications.

#### Which protocols are supported by Soffid?

<div class="pointer-container" id="bkmrk-%C2%A0"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div>- [SAML](https://bookstack.soffid.com/books/federation/chapter/saml)
- [OpenID-Connect](https://bookstack.soffid.com/books/federation/chapter/openid-connect)
- [CAS](https://bookstack.soffid.com/books/federation/chapter/cas)
- [Radius](https://bookstack.soffid.com/books/federation/chapter/radius)
- [TACACS+](https://bookstack.soffid.com/books/federation/chapter/tacacs)

## SAML (Security Assertion Markup Language)

<p class="callout info">Visit the[ SAML Chapter](https://bookstack.soffid.com/books/federation/chapter/saml "SAML") for more information.</p>

## OpenID-Connect

<p class="callout info">Visit the[ OpenID-Connect Chapter](https://bookstack.soffid.com/books/federation/page/openid-connect "OpenID-Connect") for more information.</p>

## The main differences between SAML and OpenID-connect

- OpenID-connect uses simple form encoding or JSON rather than complex XML documents.
- OpenID-connect does not encrypt or sign requests or responses. Instead, it uses simple username/password authentication leveraging HTTPS transport security.
- OpenID-connect requires server to server communication to transfer security tokens. SAML allows this kind of communication, but does not need it.

---

[*https://en.wikipedia.org/wiki/Federated\_identity*](https://en.wikipedia.org/wiki/Federated_identity)

# SAML



# SAML (Security Assertion Markup Language)

## Introduction

> Security Assertion Markup Language is an open standard for exchanging authentication and authorization data between parties, in particular, between an identity provider and a service provider.

It is an identity federation protocol, born in 2001 and published in 2005. The design of SAML is highly secure and based on the technologies used at the beginning of this century. It uses XML tokens, signed and optionally encrypted using XMLdSig standard, and uses SOAP as its transport protocol.

SAML is an important component of many SSO systems that allow users to access multiple applications, services or websites from a single login process. SAML allows sharing security credential across systems.

SAML establishes indirect communication with applications through the browser.

<div id="bkmrk-"><div>  
</div><div>  
</div><div>  
</div></div><div id="bkmrk--0"><div><div>[![saml-logo.png](https://bookstack.soffid.com/uploads/images/gallery/2021-09/scaled-1680-/0dNsaml-logo.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-09/0dNsaml-logo.png)</div></div></div><div id="bkmrk--1"></div><div id="bkmrk--2"></div>---

<div id="bkmrk-http%3A%2F%2Fsaml.xml.org%2F">[http://saml.xml.org/](http://saml.xml.org/)</div><div id="bkmrk--3"></div><div id="bkmrk-https%3A%2F%2Fen.wikipedia">[https://en.wikipedia.org/wiki/Security\_Assertion\_Markup\_Language](https://en.wikipedia.org/wiki/Security_Assertion_Markup_Language)</div>

# SAML architecture

## Introduction

SAML is the most complete, secure, and mature solution to get identity federation. SAML defines three main kinds of servers:

- Federation metadata server. Publishes information about the federation members, its protocols, and capabilities. Any federation member will only trust on other federation members.
- Identity providers are able to identify the user and publish its information to any application that requires it.
- Service providers are standard application servers that relay on identity providers to let users log in.

For now, we will focus on the **single log-in** and **single log-out** use cases, but be in mind that SAML defines much more use cases.

Communication is done through the browser

## Single Log-in

The single log-in is usually initiated by the application server. The typical UML use case is as follows:

<div drawio-diagram="410"><img src="https://bookstack.soffid.com/uploads/images/drawio/2021-09/drawing-5-1630920966.png" alt=""/></div>

### Description

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>The user’s browser tries to get a web page from the service providers.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>The service provider wants to authenticate the user identity. To get this, builds an AuthenticationRequest document. It is an XML document that includes the server name and time and date. This XML document is signed using its private key and optionally encrypted using the identity provider public key. Both keys are published by the federation metadata server.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>The service provider generates an HTML page that automatically posts the AuthenticationRequest document to the identity provider.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>The AuthenticationRequest is received by the identity provider. At this point, the identity provider verifies it is correct and safe.

Next, the identity providers checks if the user browser does have an active SSO session. In such a case, skip to step 6.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5. </span>The identity providers ask for credentials to the user.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6. </span>The user enters its credentials. At this time, the identity provider verifies the user name and password are correct, and creates a new SSO session.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7. </span>The identity provider sends a SAML assertion to the service provider. This assertion is signed using its private key and optionally encrypted using the service provider public key. The SAML assertion contains some user attributes. The included attributes and its value can vary depending on the service provider that will receive it.   
As previously seen in the authentication request, the assertion is always sent through the user’s browser.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8. </span>The service provider receives the SAML assertions, decrypts and verifies it, obtaining all the user attributes.

## Single Log-out

The single log-out process follows the next UML diagram:

<div drawio-diagram="411"><img src="https://bookstack.soffid.com/uploads/images/drawio/2021-09/drawing-5-1630921674.png" alt=""/></div>

### Description

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> The user requests to log out the application. At this point, the application (service provider) can give the user the chance to log out from any other application.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>The service provider issues a global SAML logout request to the identity provider. The SAML logout request includes the user or session id. It is signed using its private key and optionally encrypted with the identity provider public key.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>The identity provider sends a SOAP SAML logout request to any service provider with active sessions for this user. These logout requests are almost identical to the one sent from the service provider to the identity provider, but it is sent using SOAP rather than an HTTP URL.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>After closing any active session, the user is informed about the logout progress, or optionally redirected to a farewell web page specified by the service provider.

*The logout request must be signed, it is not mandatory to the login request.*

# SAML Example

## Service Provider

[![image-1681222787894.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681222787894.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681222787894.png)

# OpenID-Connect



# OpenID-Connect

## Introduction

> OpenID is an open standard and decentralized authentication protocol. It allows users to be authenticated by cooperating sites (known as relying parties, or RP) using a third-party service, eliminating the need for webmasters to provide their own ad hoc login systems, and allowing users to log into multiple unrelated websites without having to have a separate identity and password for each.

It is identity layer on top of the OAuth 2.0 protocol. OpenID-Connect is based on most modern protols. It uses JSON tokens, signed and optionally encripted using JWT standard, and uses simple REST as its transport protocol.

Sometimes referred as OpenID, must not be confused with an older and deprecated standard named OpenID.

[![1024px-OpenID_logo_2.svg.png](https://bookstack.soffid.com/uploads/images/gallery/2021-09/scaled-1680-/1024px-openid-logo-2-svg.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-09/1024px-openid-logo-2-svg.png)

---

*[https://openid.net/](https://openid.net/)*

*[https://en.wikipedia.org/wiki/OpenID#OpenID\_Connect\_(OIDC)](https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC))*

# OpenID-Connect architecture

## Introduction

OpenID is based on the well known protocol. It is easier to implement and deploy, as it does not require digital signature or encryption. The drawback is that it is significantly less secure. For example, the single logout protocol is not finished yet.

## Single Log-in

The usual log-in process follows the next UML diagram:

<div drawio-diagram="1274"><img src="https://bookstack.soffid.com/uploads/images/drawio/2022-11/drawing-5-1667471968.png" alt=""/></div>

### Description

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> User’s browser tries to get a web page from the service providers

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> . The service provider wants to authenticate the user identity. To get this, redirects the user to the identity provider, including the returning URL.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> The authorization request is received by the identity provider. At this point, the identity provider verifies it is issued by an authorized service provider.

Next, the identity providers checks if the user browser does have an active SSO session. In such a case, skip to step 6.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> The identity providers ask for credentials to the user.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> The user enters its credentials. At this time, the identity provider verifies the user name and password are correct, and creates a new SSO session.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> The identity provider redirects the user to the service provider, sending an authorization code.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7. </span>The service provider connects to the identity provider, using its client id and client secret, as well as the authorization code.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8.</span> The identity provider verifies the authorization code and generates two tokens: the oAuth token and the OpenID token. The Auth token is a bare token that can be used by the service provider to perform additional requests.

The Openid token contains some user attributes. The included attributes and its value can vary depending on the service provider that will receive it. This token can be signed using JWT standard.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">9.</span> The service provider receives the both tokens, parsing the JSON document contained in the JWT OpenID token.

## Single Log-out

One generic logout process diagram:

<div drawio-diagram="1278"><img src="https://bookstack.soffid.com/uploads/images/drawio/2022-11/drawing-5-1667550432.png" alt=""/></div>

### Description

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> The user requests to log out the application.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> Logout in the Service Provider, for instance, delete cookies.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Redirect to the Identity Provider logout endpoint

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> Logout in the Identity Provider, for instance, delete cookies.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> The Identity Provider can trigger logout from other Service Providers using Font-channel or Back-channel.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> The Identity Provider redirects to the Service Provider EndPoint

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.</span> The Service Provider returns successfully logout

# OpenID-Connect example

## Identity Provider

[![image-1661408366204.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661408366204.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661408366204.png)

## Service Provider

[![image-1661408426358.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661408426358.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661408426358.png)

# CAS



# CAS (Central Authentication Service)

## Introduction

> The CAS protocol is a simple and powerful ticket-based protocol. It involves one or many clients and one server. Clients are embedded in CASified applications (called “CAS services”) whereas the CAS server is a standalone component.

The Cas protocol makes it possible to implement the SSO authentication method that allows users to access web applications with a single sign-on.

The specification versions recognized are 3.0.3 and 2.0

[![cas_max_logo_0.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/cas-max-logo-0.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/cas-max-logo-0.png)

---

[*https://apereo.github.io/cas/6.5.x/protocol/CAS-Protocol.html*](https://apereo.github.io/cas/6.5.x/protocol/CAS-Protocol.html)

# CAS architecture

## Introduction

The CAS is a Single Sign On protocol for the web. This protocol allows users to access multiple applications by providing their credentials.

The response will be a JSON or XML


## Single Log-in

The single log-in is usually initiated by the application server. The typical UML use case is as follows:

[![image-1661327423181.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661327423181.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661327423181.png)

## Proxy web flow diagram

[![image-1661327695882.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661327695882.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661327695882.png)

---

*[https://en.wikipedia.org/wiki/Central\_Authentication\_Service](https://en.wikipedia.org/wiki/Central_Authentication_Service)*

# CAS Example

## Service Provider

## [![image-1661408241083.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661408241083.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661408241083.png)

# Radius



# Radius (Remote Authentication Dial-In User Service)

## Introduction

> The Radius protocol (Remote Authentication Dial-In User Service) is a networking protocol that authorizes and authenticates users who access a remote network.

---

[https://es.wikipedia.org/wiki/RADIUS](https://es.wikipedia.org/wiki/RADIUS)

# Radius architecture

## Introduction

[![image-1661408963698.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661408963698.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661408963698.png)

**Access Reject:** The user is unconditionally denied access to all requested network resources. Reasons may include failure to provide proof of identification or an unknown or inactive user account.

**Access Challenge:** Requests additional information from the user such as a secondary password, PIN, token, or card. Access Challenge is also used in more complex authentication dialogs where a secure tunnel is established between the user machine and the Radius Server in a way that the access credentials are hidden from the NAS.

**Access Accept:** The user is granted access. Once the user is authenticated, the RADIUS server will often check that the user is authorized to use the network service requested. A given user may be allowed to use a company's wireless network, but not its VPN service, for example. Again, this information may be stored locally on the RADIUS server, or may be looked up in an external source such as LDAP or Active Directory.

---

[https://en.wikipedia.org/wiki/RADIUS](https://en.wikipedia.org/wiki/RADIUS)

# Radius Example

## Service Provider

[![image-1661409204083.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661409204083.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661409204083.png)

# TACACS+

Tacacs+

# TACACS+ (The Terminal Access Controller Access-Control System Plus)

> TACACS+ is a security protocol that provides centralized validation of users who are attempting to gain access to a router or other devices.
> 
> TACACS+ is a protocol for AAA services:
> 
> - Authentication
> - Authorization
> - Accounting

---

[*https://www.rfc-editor.org/rfc/rfc8907.html*](https://www.rfc-editor.org/rfc/rfc8907.html)

# TACACS+ architecture

## Introduction

<div drawio-diagram="1411"><img src="https://bookstack.soffid.com/uploads/images/drawio/2023-04/drawing-5-1681113697.png" alt=""/></div>

# TACACS+ Example

## Service Provider

[![image-1681221680349.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221680349.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221680349.png)

## Information Systems

When a Tacacs Service Provider is created, Soffid creates an Information System

[![image-1681221732876.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221732876.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221732876.png)

There are some roles defined for this Information System (0: anonymous, 1: user, ....15: root)

[![image-1681221803826.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221803826.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221803826.png)

# WS-Fed

WS-Federation

# WS-Fed

> WS-Federation (Web Services Federation) is an Identity Federation specification
> 
> WS-Federation defines mechanisms for allowing different security realms to broker information on identities, identity attributes and authentication. WS-Federation focuses on federated identity and trusting authentication tokens across different realms, privileged password management is concerned with the security, control, and audit of high-risk account passwords within an IT environment

<p class="callout warning">WS-Fed will only be used with **Exchange** and a few other applications.</p>

---

*[https://en.wikipedia.org/wiki/WS-Federation](https://en.wikipedia.org/wiki/WS-Federation)*

# WS-Fed Architecture

## Introduction

WS-Federation (Web Services Federation) is an Identity Federation specification

### Sign-On  


<div drawio-diagram="1828"><img src="https://bookstack.soffid.com/uploads/images/drawio/2023-09/drawing-5-1695822597.png" alt=""/></div>

---

[*http://docs.oasis-open.org/wsfed/federation/v1.2/cd/ws-federation-1.2-spec-cd-01.html*](http://docs.oasis-open.org/wsfed/federation/v1.2/cd/ws-federation-1.2-spec-cd-01.html)

# WS-Fed Example

## Steps

### Attribute definition

First of all, will be mandatory to create two new attributes

- User principal name
- AD SID

[![image-1695799061910.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695799061910.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695799061910.png)

Bear in mind, that those attributes have to be retrieved from the appropriate system:

[![image-1695803778715.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695803778715.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695803778715.png)

And those attributes have to be defined in the object metadata:

[![image-1695804665489.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695804665489.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695804665489.png)

### Attribute sharing policies

Define the proper attribute policy

[![image-1695801239762.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695801239762.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695801239762.png)

### Service Provider

[![image-1695801347498.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695801347498.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695801347498.png)

### Configure Exchange

Finally, you must configure the Exchange.

1.- Upload the SAML certificate to the certificate repository

2.- Search for the thumbprint of the certificate:

```
Set-Location Cert:\LocalMachine\Root; Get-ChildItem | Short-Object Subject
```

[![image-1695814095103.png](https://bookstack.soffid.com/uploads/images/gallery/2023-09/scaled-1680-/image-1695814095103.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-09/image-1695814095103.png)

3.- From the Exchange Management Shell, run:

```
Set-OrganizationConfig -AdfsIssuer https://gbr.idp.demo.soffid.net/profile/wsfed `
   -AdfsAudienceUris "https://gbr.owa.demo.soffid.net/owa/","https://gbr.owa.demo.soffid.net/ecp/"  `
   -AdfsSignCertificateThumbprint "XXXXXXXXXXXXXXXX"
```

```
Set-OWAVirtualDirectory -Identity "OWA (Default Web Site)" -AdfsAuthentication $true   `
  -BasicAuthentication $false -DigestAuthentication $false -FormsAuthentication $false `
  -WindowsAuthentication $false
```

```
Set-ECPVirtualDirectory -Identity "ECP (Default Web Site)" -AdfsAuthentication $true   `
  -BasicAuthentication $false -DigestAuthentication $false -FormsAuthentication $false `
  -WindowsAuthentication $false
```

```
net stop was /y
```

```
net start  w3svc
```

<p class="callout warning">The server must be up to date. Otherwise WS-Fed will reject the response</p>

# How to install Federation in Soffid?

## Installation

### Download

Please download the Soffid Federation add-on.

You could download it at the following link [http://www.soffid.com/download/enterprise/](http://www.soffid.com/download/enterprise/) if you have a Soffid user with authorization, or in the following [http://download.soffid.com/download/](http://download.soffid.com/download/) by registering.

### Upload

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Once the Federation add-on is downloaded, please log in to IAM Console.

<p class="callout info">You need to be an administrator user of the Soffid console or a user with permission to upload addons.</p>

<p class="callout info">It is recommended to upload the addons to the master, this is the way to maintain updated all, master and tenants if there are.</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> In the Soffid console, please go to:

`Main Menu > Administration > Configure Soffid > Global Settings > Plugins`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Then, click the add button (+) and pick the file and Soffild will upload the addon file.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> Finally, when the addon is installed, it will be required to **restart the Soffid Console and the Sync Server.**

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> Once the Soffid console is restarted, you could check the plugin was uploaded properly on the plugins page:

`Main Menu > Administration > Configure Soffid > Global Settings > Plugins`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> Now, you can set up the Federation.

# Web SSO



# ⏰ Getting started

## Introduction

---

To configure the Web SSO you must complete the next steps

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>Attribute definition**: add the necessary attributes if they are not in the list.

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>Attribute sharing policies**: define the proper attribute sharing policies to determine which attributes will be shared. The policies will apply to those IdPs that meet the conditions defined in the policy. You can define public policies that apply to all IdPs, or specific policies that only apply to certain IdPs.

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>Identity &amp; Service providers**: configure the identity and the service provider.

---

Soffid performs the validation in the following order

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>Login**: first of all, it checks the login, if the access is correct then follow the next step

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>Policies**: then, it checks the attribute sharing policies. Soffid checks all policies and applies the ones that meet the conditions.

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>Attributes**: For policies that result in Yes or True, the attribute conditions will be evaluated. The attributes will be shared when the conditions are true.

# Attribute definition

## Description

The attribute definition page displays all the **auto-generated user attributes**. Those attributes will be the attributes to deliver from the identity providers to the service providers depending on the defined rules.

Soffid has a default implementation for common attributes like FullName or uid, but you can modify it by creating a custom script.

## Screen overview

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-enety9lr.png)

## Custom attributes

- **Name**: a descriptive name.
- **ShortName**: short name to be used by SAML 2 service providers (without blanks).
- **Oid**: OID to be used by SAML 1 and SAML 2 service providers.
- **OpenID name**: OpenID name to be used by OAuth and OpenID connect service provider.
- **Radius ID**: Radius ID name.
- **Value**: an attribute value. Allows you to define a BeanShell script to determine the value of the attribute.

## Examples

Soffid IdP has a default implementation for common attributes like FullName or uid, but you can modify it by creating a custom script. You can use the custom script to define the value of an attribute.

Examples to define the value of an attribute.

#### Example 1

Return full name in upper case:

```Java
return fullName.toUpperCase();
```

#### Example 2

Send one value if an attribute is blank. Otherwise, its value:

```Java
return
    attributes{"company"} == null ||
    attributes{"company"}.isEmpty() ?
        "Soffid" :
        attributes{"company"}
```

#### Example 3

Use serverService to fech the OU attribute of the account owned by the user in the Active Directory (AD) system:

```JSON
for (account: serverService.getUserAccounts(id, "ad")) {
    return account{"attributes"}{"ou"};
}
return null;
```

## Actions

#### Attribute definition query

<table border="1" id="bkmrk-add-or-remove-column" style="width: 797px;"><tbody><tr><td style="width: 191px;">**Add new**

</td><td style="width: 606px;">Allows you to add a new attribute definition in the system. You can choose that option on the hamburger menu or clicking the add button (+).

To add a new it is necessary to fill in the required fields.

</td></tr><tr><td style="width: 191px;">**Delete**</td><td style="width: 606px;">Allows you to remove one or more Attribute definitions by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 191px;">**Import**</td><td style="width: 606px;">Allows you to upload a CSV file with the attribute definition to add or update attribute definition to Soffid.

First, you need to pick up a CSV file, that CSV has to contain a specific configuration. Then you need to check the content to be loaded, it is allowed to choose if you want or not to load a specific attribute. And finally, you need to select the mappings for each column of the CSV file to import the data correctly and to click the Import button.

</td></tr><tr><td style="width: 191px;">**Download CSV file**

</td><td style="width: 606px;">Allows you to download a CSV file with the basic information of all attribute definitions.

</td></tr></tbody></table>

#### Attribute definition detail

<table border="1" id="bkmrk-delete-allows-to-rem"><tbody><tr style="height: 28px;"><td style="width: 190.909px; height: 28px;">**Delete**

</td><td style="width: 605.455px; height: 28px;">Allows you to save the data of a new Attribute definition or to update the data of a specific Attribute definition. To save the data it will be mandatory to fill in the required fields.

</td></tr><tr style="height: 28px;"><td style="width: 190.909px; height: 28px;">**Save**

</td><td style="width: 605.455px; height: 28px;">Allows you to download a csv file with the basic information of the Attribute definition.

</td></tr></tbody></table>

# Attribute sharing policies

## Description

After defining the attributes to publish, it’s required to write a policy that defines which attributes will be allowed to share with each service provider.

Soffid allows you to define security rules that apply to any attribute that should be delivered from identity providers to service providers.

## Custom attributes

- **Policy**: policy name.
- [**Condition** (policy)](#bkmrk-condition): a boolean expression that will be evaluated first. If this expression evaluates to false, the rule is completely ignored. It is used to evaluate to which applies the policy.
- **Attributes List**: allows you to add attributes with the proper condition for each one. 
    - **Attribute**: allows you to select an attribute from the attribute list. Those attributes are defined at the Attribute definition page.
    - **Allow**: if selected value is Yes, the attribute will be shared when the condition was true. If selected value is No, the attribute will no be shared.
    - [**Condition** (shared attributes)](#bkmrk-condition): a boolean expression to be evaluated. Allows you to customize a condition to evaluated and decide if the attribute should or not be delivered

#### Condition

It is a boolean expression to be evaluated. The condition will be evaluatuated when the Allow value was yes. You can use the conditions to configure the **conditions policy** and to configure the **shared attributes**.

The boolean operator are the follow:

- **ANY**: the result will always be true.
- **OR**: the result will be true if any of its subexpressions are true
- **AND**: the result will be true if all of its subexpressions are true.
- **Attribute requester**: the result will be true if the service provider public id equals the specified value. Optionally, the ignore case checkbox will ignore upper and lower case differences.
- **Attribute Issuer**: the result will be true if the identity provider public id equals the specified value. Optionally, the ignore case checkbox will ignore upper and lower case differences.
- **PrincipalName**: the result will be true if the principal name equals the specified value. Optionally, the ignore case checkbox will ignore upper and lower case differences. Mind that some service providers want to use the email address as PrincipalName. Some others use the account name or X.509 subject name.
- **Authentication Method**: the result will be true if the used authentication method equals the specified value. Optionally, the ignore case checkbox will ignore upper and lower case differences. Some useful values are: 
    - When using SAML, it contains the standard SAML identifier corresponding to the used authentication method. When multifactor authentication is used, it contains the strongest one: 
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport** password authentication (using SSL)
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:PreviousSession** already authenticated using previous session
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:X509** user has a X.509 certificate
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient** X.509's public key has been verified using TLS protocol
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken** time synchronized token.
        - **urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified** unspecified protocol. This tag is used when Soffid IDP relies on third party identity providers that don't give information about the authentication method used, such as oAuth or OpenId.
    - When using OpenID connect, the value can be any of:
        
        
        - **P**: Password
        - **PO**: Password + OneTimePassword
        - **PC**: Password + Certificate
        - **PE**: Password + External identity provider
        - **K**: Kerberos token
        - **KO**: Kerberos token + OneTimePassword
        - **KC**: Kerberos token + Certificate
        - **KE**: Kerberos token + External identity provider
        - **E**: External identity providers
        - **EO**: External identity provider + One time password
        - **EC**: External identity provider + Certificate
        - **O**: One time password
        - **OC**: One time password + Certificate
        - **C**: Certificate
- **Attribute value**: the result will be true if the related attribute has a specific value.
- **Attribute requester (regex)**: the result will be true if the service provider public id matches the specified regular expression.
- **Attribute issuer (regex)**: the result will be true if the identity provider public id matches the specified regular expression.
- **Principal name (regex)**: the result will be true if the principal name matches the specified regular expression. Mind that some service providers want to use the email address as PrincipalName. Some others use the account name or X.509 subject name.
- **Authentication method (regex)**: the result will be true if the used authentication method matches the specified regular expression.
- **Attribute value (regex)**: the result will be true if the related attribute has a specific value.
- **Attribute requester in entity group**: the result will be true if the service provider belongs to the specified group.
- **Attribute issuer in entity group**: the result will be true if the identity provider belongs to the specified group.
- **Attribute issuer nameID format**: the result will be true if the identity provider supports a specified identifier format.
- **Issuer entity attribute**: the result will be true if the identity provider metadata contains a specified attribute name and value.
- **Issuer entity attribute (regex)**: the result will be true if the identity provider metadata contains an attribute name and value that matches the specified regular expression.
- **Requester entity attribute**:the result will be true if the service provider metadata contains a specified attribute name and value.
- **Requester entity attribute (regex)**:the result will be true if the service provider metadata contains an attribute name and value that matches the specified regular expression.
- **Attribute requester nameID format**: the result will be true if the service provider supports a specified identifier format.

## Examples

Examples to define conditions in an attribute sharing policy:

#### Example 1

Give the email address and the user ID to any trusted service provider. We define this as a public policy.

[![image-1651591008906.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1651591008906.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1651591008906.png)

[![image-1652347213357.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652347213357.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652347213357.png)

#### Example 2

Give some extra attributes, like full name and roles to any service provider belonging to soffid-demo entity group

[![image-1651732807889.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1651732807889.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1651732807889.png)

[![image-1652347060000.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652347060000.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652347060000.png)

#### Example 3

Rule that will be applied to the service provider named “test’ or any other service provider whose name starts with “soffid-”

[![image-1652347158677.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652347158677.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652347158677.png)

[![image-1652347180776.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652347180776.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652347180776.png)

## Actions

#### Attribute sharing policies query

<table border="1" id="bkmrk-add-or-remove-column" style="width: 797px;"><tbody><tr><td style="width: 167.997px;">**Add new**

</td><td style="width: 628.991px;">Allows you to add a new Attribute sharing policies in the system. You can choose that option on the hamburger menu or clicking the add button (+).

To add a new it is necessary to fill in the required fields.

</td></tr><tr><td style="width: 167.997px;">**Delete**

</td><td style="width: 628.991px;">Allows you to remove one or more Attribute sharing policies by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 167.997px;">**Import**</td><td style="width: 628.991px;">Allows you to upload a CSV file with the ttribute sharing policies to add or update Attribute sharing policies to Soffid.

First, you need to pick up a CSV file, that CSV has to contain a specific configuration. Then you need to check the content to be loaded, it is allowed to choose if you want or not to load a specific attribute. And finally, you need to select the mappings for each column of the CSV file to import the data correctly and to click the Import button.

</td></tr><tr><td style="width: 167.997px;">**Download CSV file**

</td><td style="width: 628.991px;">Allows you to download a CSV file with the basic information of all Attribute sharing policies.

</td></tr></tbody></table>

#### Attribute sharing policies detail

<table border="1" id="bkmrk-delete-allows-to-rem" style="width: 795px;"><tbody><tr style="height: 28px;"><td style="width: 165.199px; height: 28px;">**Delete**

</td><td style="width: 628.807px; height: 28px;">Allows you to save the data of a new Attribute sharing policy or to update the data of a specific Attribute sharing policy. To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 165.199px;">**Apply changes**

</td><td style="width: 628.807px;">Allows you to save the data of a new Metada object or to update the data of a specific Metadata object. To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 165.199px;">**Undo**

</td><td style="width: 628.807px;">Allows you to quit without applying any changes made.

</td></tr></tbody></table>

# Identity & Service providers

## Description

<p class="callout success">Soffid Identity Federation addon helps administrators to manage an Identity Federation. With Soffid you can manage the whole federation security configuration, increasing the security while reducing the federation management costs. Soffid can also act as a Service Provider, serving identities to any SAML capable application server.</p>

The main supported standard is [SAML](http://en.wikipedia.org/wiki/SAML_2.0). SAML allows to completely detach the identification process from web applications, known as Service Providers. With SAML, identification is performed by specialized servers known as Identity Providers. Additionaly, some other, less secure, but some times convenient protocols like [OAuth](https://en.wikipedia.org/wiki/OAuth) (Open Authorization) and [OpenID-Connect](https://en.wikipedia.org/wiki/OpenID_Connect) protocols are supported. Elder protocols like Openid (do not confuse with OpenID-Connect) are deprecated and no longer supported.

<p class="callout info">You can visit the Introduction page to find more information about the [federation members](https://bookstack.soffid.com/link/325#bkmrk-federation-members).</p>

## Federation members

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>[Entity Group](#bkmrk-entity-group)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>[Identity Provider](#bkmrk-identity-provider)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>[Service Provider](#bkmrk-service-provider)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>[Virtual Identity Provider](#bkmrk-virtual-identity-pro)

## Entity Group

{{@389}}

## Identity Provider

{{@390}}

## Service Provider

{{@392}}

## Virtual Identity Provider

{{@391}}

## Actions

#### Federation Tree view

<table border="1" id="bkmrk-apply-changes-allow-" style="height: 417px;"><tbody><tr style="height: 101px;"><td style="width: 190px; height: 101px;">**Add group**

</td><td style="width: 619px; height: 101px;">Allows you to create a new Entity group. You can choose that option by clicking on the "Add group" button, then Soffid will display a new window with the fields to fullfil.

To add a new Entity group it will be mandatory to fill in the required fields and save or apply changes..

</td></tr><tr style="height: 123px;"><td style="width: 190px; height: 123px;">**Add identity provider**

</td><td style="width: 619px; height: 123px;">Allows you to add a new Identity Provider. You must click the "Add identity provider" button, under the proper Entity Group and "Identity Provider" label, then Soffid will display a new window with the data to fulfill for new Identity Provider.

To add a new Identity provider it will be mandatory to fill in the required fields and save or apply changes..

</td></tr><tr style="height: 123px;"><td style="width: 190px; height: 123px;">**Add virtual identity provider**

</td><td style="width: 619px; height: 123px;">Allows you to add a Virtual Identity Provider. You must click the "Add virtual identity provider" button, under the proper Identity Provider, which has to be a Soffid IdP, then Soffid will display a new window with the data to fulfill for the new Virtual identity provider.

To add a new Virtual identity provider it will be mandatory to fill in the required fields and save or apply changes..

</td></tr></tbody></table>

#### Entity goup 

##### List

<table id="bkmrk-add-new-from-the-fed" style="height: 181px;"><tbody><tr style="height: 79px;"><td style="width: 156.79px; height: 79px;">**Add new**

</td><td style="width: 623.125px; height: 79px;">You can add a new Entity groups by clicking on the add button (+). Then Soffid will display a new window and you need to fill in the required fields and save or apply changes.

</td></tr><tr style="height: 102px;"><td style="width: 156.79px; height: 102px;"> **Delete**

</td><td style="width: 623.125px; height: 102px;">Allows you to remove one or more Entity group by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr></tbody></table>

##### Detail

<table id="bkmrk-apply-changes-allows"><tbody><tr><td style="width: 149.984px;">**Save**</td><td style="width: 659.016px;">Allows you to save the data of a new Entity group or to update the data of a specific Entity group.

To save the data it will be mandatory to fill in the required fields

</td></tr><tr><td style="width: 149.984px;">**Apply changes**

</td><td style="width: 659.016px;">Allows you to save the data of a new Entity group or to update the data of a specific Entity group and quit.

To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 149.984px;">**Delete**

</td><td style="width: 659.016px;">Allows you to delete the Entity group. To delete a host you can click on the hamburger icon and then click the delete button (trash icon).

Soffid will ask you for confirmation to perform that action, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 149.984px;">**Undo**

</td><td style="width: 659.016px;">Allows you to quit without applying any changes made.

</td></tr></tbody></table>

#### Identity Provider

##### List

<table id="bkmrk-add-new-you-can-add-"><tbody><tr style="height: 79px;"><td style="width: 156.79px; height: 79px;">**Add new**

</td><td style="width: 623.125px; height: 79px;">You can add a new Identity provider by clicking on the add button (+). Then Soffid will display a new window and you need to fill in the required fields and save or apply changes.

</td></tr><tr style="height: 102px;"><td style="width: 156.79px; height: 102px;"> **Delete**

</td><td style="width: 623.125px; height: 102px;">Allows you to remove one or more Identity providers by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr></tbody></table>

##### Detail

<table id="bkmrk-save-%C2%A0-allows-you-to"><tbody><tr><td style="width: 149.984px;">**Save**</td><td style="width: 659.016px;">Allows you to save the data of a new Identity provider or to update the data of a specific Identity provider.

To save the data it will be mandatory to fill in the required fields

</td></tr><tr><td style="width: 149.984px;">**Apply changes**

</td><td style="width: 659.016px;">Allows you to save the data of a new Identity provider or to update the data of a specific Identity provider and quit.

To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 149.984px;">**Delete**

</td><td style="width: 659.016px;">Allows you to delete the Identity provider. To delete a host you can click on the hamburger icon and then click the delete button (trash icon).

Soffid will ask you for confirmation to perform that action, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 149.984px;">**Undo**

</td><td style="width: 659.016px;">Allows you to quit without applying any changes made.

</td></tr></tbody></table>

#### Service Provider

##### List

<table id="bkmrk-add-new-you-can-add--0"><tbody><tr style="height: 79px;"><td style="width: 156.79px; height: 79px;">**Add new**

</td><td style="width: 623.125px; height: 79px;">You can add a new Service provider by clicking on the add button (+). Then Soffid will display a new window and you need to fill in the required fields and save or apply changes.

</td></tr><tr style="height: 102px;"><td style="width: 156.79px; height: 102px;"> **Delete**

</td><td style="width: 623.125px; height: 102px;">Allows you to remove one or more Service providers by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr></tbody></table>

##### Detail

<table id="bkmrk-save-%C2%A0-allows-you-to-0"><tbody><tr><td style="width: 149.984px;">**Save**</td><td style="width: 659.016px;">Allows you to save the data of a new Service provider or to update the data of a specific Service provider.

To save the data it will be mandatory to fill in the required fields

</td></tr><tr><td style="width: 149.984px;">**Apply changes**

</td><td style="width: 659.016px;">Allows you to save the data of a new Identity provider or to update the data of a specific Service provider and quit.

To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 149.984px;">**Delete**

</td><td style="width: 659.016px;">Allows you to delete the Service provider. To delete a host you can click on the hamburger icon and then click the delete button (trash icon).

Soffid will ask you for confirmation to perform that action, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 149.984px;">**Undo**

</td><td style="width: 659.016px;">Allows you to quit without applying any changes made.

</td></tr></tbody></table>

#### Virtyal Identity Provider

##### List

<table id="bkmrk-add-new-you-can-add--1"><tbody><tr style="height: 79px;"><td style="width: 156.79px; height: 79px;">**Add new**

</td><td style="width: 623.125px; height: 79px;">You can add a new Virtual identity provider by clicking on the add button (+). Then Soffid will display a new window and you need to fill in the required fields and save or apply changes.

</td></tr><tr style="height: 102px;"><td style="width: 156.79px; height: 102px;"> **Delete**

</td><td style="width: 623.125px; height: 102px;">Allows you to remove one or more Virtual identity providers by selecting one or more records and next clicking the button with the subtraction symbol (-).

To perform that action, Soffid will ask you for confirmation, you could confirm or cancel the operation.

</td></tr></tbody></table>

##### Detail

<table id="bkmrk-save-%C2%A0-allows-you-to-1"><tbody><tr><td style="width: 149.984px;">**Save**</td><td style="width: 659.016px;">Allows you to save the data of a new Virtual identity provider or to update the data of a specific Virtual identity provider.

To save the data it will be mandatory to fill in the required fields

</td></tr><tr><td style="width: 149.984px;">**Apply changes**

</td><td style="width: 659.016px;">Allows you to save the data of a new Virtual identity provider or to update the data of a specific Virtual identity provider and quit.

To save the data it will be mandatory to fill in the required fields.

</td></tr><tr><td style="width: 149.984px;">**Delete**

</td><td style="width: 659.016px;">Allows you to delete the Virtual identity provider. To delete a host you can click on the hamburger icon and then click the delete button (trash icon).

Soffid will ask you for confirmation to perform that action, you could confirm or cancel the operation.

</td></tr><tr><td style="width: 149.984px;">**Undo**

</td><td style="width: 659.016px;">Allows you to quit without applying any changes made.

</td></tr></tbody></table>

---

[*https://en.wikipedia.org/wiki/Federated\_identity*](https://en.wikipedia.org/wiki/Federated_identity)

*[https://en.wikipedia.org/wiki/Identity\_provider](https://en.wikipedia.org/wiki/Identity_provider)*

[*https://en.wikipedia.org/wiki/Service\_provider*](https://en.wikipedia.org/wiki/Service_provider)

# Shared signals & events members

{{@1198}}

# Federation members



# Entity Group

### Description

An entity group is just like a folder that allows you to manage different kinds of federation members. One of the most common ways to group federation members is by trust level.

When you create an entity group, the Identity Providers and the Service Providers records will be displayed. Then you could add identities and services selecting the proper record.

### Screen overview

[![image-1652360950792.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652360950792.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652360950792.png)

### Standard attributes

- **Entity Group**: name of the group.
- **Url Metadata**: will be the URL of an external entity group when the entity group was esternal.
- **Providers**: by default, it creates two groups, an identity provider and a service provider.

# Identity Provider

### Description

> An identity provider (abbreviated IdP or IDP) is a system entity that creates, maintains, and manages identity information for principals and also provides authentication services to relying applications within a federation or distributed network.

An Identity Provider is responsible for identifying users. Also, it is responsible for giving service providers information regarding the identified user.

Soffid allows you to configure different identity providers, you can choose the best option for you by selecting the IdP type:

- [**Soffid IdP**:](#bkmrk-soffid-idp) identifies the identity provider implemented by Soffid. Soffid IdP implements both OpenID-Connect and SAML.
- [**External SAML IdP**](#bkmrk-external-saml-idp): is used to identify providers not implemented by Soffid. For instance, it could be an ADFS (Active Directory Federation Services) or Shibboleth identity provider.
- [**OpenID-Connect**](#bkmrk-openid-connect): is used for third-party identity providers, like ADFS.
- [**Facebook**](#bkmrk-facebook): if you select that option, oAuth2 will be used to identify Facebook users. You will need to register Soffid as a Facebook application to use it.
- [**Google**](#bkmrk-google): if you select that option OpenID-Connect will be used to identify Google users. You will need to register Soffid as a Google application to use it.
- [**LinkedIn**](#bkmrk-linkedin): if you select that option, oAuth2 will be used to identify LinkedIn users. You will need to register Soffid as a LinkedIn application to use it.

To create an identity provider, it is advisable to install a dedicated sync server. It can be configured as a proxy sync server as it does not need direct access to the Soffid database. Instead, it will connect to the main sync server to get users and federation information.

<p class="callout info">For more information about how to configure a dedicated sync server, you can visit the [Install Sync server page](https://bookstack.soffid.com/link/31#bkmrk-next-servers-configu).</p>

### Standard attributes

The fields for each IdP type are detailed below:

#### Soffid IdP

##### Identification

- **publicID**: unique name to identify the identity provider. The name has to be the same as the Public ID of the Soffid Identity Provider agent.
- **Name**: friendly user name.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

<p class="callout info">It will be mandatory to create an Agent (Soffid Identity Provider).</p>

##### Service Configuration

- **Metadata**: the Metadata for an Identity Provider defines how this Identity Provider delivers its service: 
    - Which security algorithms does it support.
    - The public portion of it's signing and encrypting keys.
    - The SAML protocols do it support.
    - The URL of each SAML protocol endpoint.
    - Contact information.

The Metadata is the information that any application needs to use the IdP. That is an XML file that contains the public encryption keys and the services provided

Leave it blank as Soffid IdP will fulfill it for you.

<p class="callout warning">The metadata will be created when the network data and SAML Security data. Restarting the sync server will be necessary to fill in the Metadata.</p>

##### Network

- **Host name**: public hostname that will be used by users and service providers. The full qualified name should be used.
- **Allow IdP to be included inside an IFRAME**: Soffid allows you to configure the Identity Provider to be incluided within a IFRAME. If this option is updated, the Sync Server must be restarted. *This attribute will be available in Federation addon 3.5.37 or higher.*
- **Network ports**: 
    - **Behind a reverse proxy**
    - **Reverse proxy port number**: port where the reverse proxy is listening.
    - **Reverse proxy incoming address**: IP addresses allowed to make calls to the reverse proxy.
    - **Port**: TCP port number used by the identity provider. By default, TLS will be used (default 1443).
    - **Encryption**: encryption type is only allowed behind a reverse proxy.
    - **Support PROXY protocol v2**: protocol between the reverse proxy and the Identity Provider.
    - **Accept client certificate**
    - **Certificate header**: certificate data header (only behind a reverse proxy).
    - **Excluded protocols**: encryption protocols to be excluded.

<details id="bkmrk-%F0%9F%92%BB-image"><summary>💻 Image</summary>

[![image-1709029065265.png](https://bookstack.soffid.com/uploads/images/gallery/2024-02/scaled-1680-/image-1709029065265.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-02/image-1709029065265.png)

</details>- **TLS PublicKey**: there are three available options 
    - **Leave in blank** and Soffid IdP will generate a self-signed certificate.
    - Clicking on the **Generates public/private key** button, a new private key pair will be generated. Once the private key pair is generated, you could generate a certificate request file, also known as PKCS#10 or CSR file. The certificate authority will be able to create a certificate for you using this certificate request. Once you have created the public/private key, you could run other new functions: 
        - **Change public/private key**: allows you to change the public/private key generated previously.
        - **Delete public/private key**: allows you to delete the public/private key generated previously.
        - **Generate PKCS10**: generates a PKCS10 file (Certification request standard).
    - Clicking on the **Upload PKCS12 file** button it will be able to upload a PKCS#12 file. That file must contain the private and public keys and the server certificate as well. Mind that PKCS#12 file use to be protected by a PIN.
- **TLS Certificate chain**: text certificate chain created with one of the previous options.

<p class="callout info">**Server certificate management:** there are two options for certificate management. You can visit the [Server certificate management page](https://bookstack.soffid.com/books/federation/page/server-certificate-management "Server certificate management") for more information.</p>

##### SAML Security

- **PublicKey**:   
    
    - Clicking on the **Generates public / private key** button, a new private key pair will be generated. Once the private key pair is generated, you could generate a certificate request file, also known as PKC#10 or CSR file. The certificate authority will be able to create a certificate for you using this certificate request. Once you have created the public/private key, you could run other new functions: 
        - **Change public/private key**: allows you to change the public/private key generated previously.
        - **Delete public/private key**: allows you to delete the public/private key generated previously.
        - **Generate PKCS10**: generates a PKCS10 file (Certification request standard).
    - Clicking on the **Upload PKCS12 file** button it will be able to upload a PKCS#12 file. That file must to contain the private an public keys and the server certificate as well. Mind that PKCS#12 file use to be protected by a PIN.
- **Certificate chain**: text certificate chain created with one of the previous options.

##### Session management

- **Session timeout (secs)**: time in seconds that will take the session. If the user has been authenticated, and later is requested to authenticate again, the user will be authenticated without any intervention as long as the timeout has not been elapsed.
- **oAuth Session timeout (secs)**: time in seconds that will take the oAuth session. The oAuth has its own life cycle, regardless the session timeout.
- **Maximum session duration (secs) :** maximum time during which session can be renewed
- **SSO Cookie name**: name of the cookie that will keep the session id, you can change the name. This SSO cookie is not really needed, as the identity provider will store a session cookie to track the SSO session. This SSO cookie is needed in two circumstances: 
    - When the identity provider is restarted, the session cookie is lost. This SSO Cookie allows the identity provider to restart the lost session.
    - When you have more than one identity provider instance, this cookie allows all the identity providers to handle the session as if only was one identity provider. The SSO cookie can be allocated by any identity provider, and it will be accepted by any other one.
- **SSO Cookie domain**: is needed when you have more than one identity provider instance and they are using different host names. If all the identity providers are serving the same virtual host name, the SSO Cookie domain will be needed.

##### Authentication

- **Authentication methods**: matrix to define the authentication methods that will be required to successfully authenticate the user. Each row indicates the first authentication method, and each column indicates the second factor to use. 
    - Password
    - Kerberos
    - External IdP
    - OTP
    - Email
    - SMS
    - PIN Certificate
    - FIDO
    - Push
- **Adaptive authentication**: that option allows you to add an additional authentication matrix which will be run when the condition defined was <span style="font-weight: 400;">complied with</span>. That is the way to change the authentication method depending on the environment. 
    - **Description**: rule description to identify it.
    - **Condition**: script to enable that rule. The result of the rule must be true or false. There are some available vars to create the condition. You can visit the [Condition for Adaptive authentication page](https://bookstack.soffid.com/books/federation/page/condition-for-adaptive-authentication "Condition for Adaptive authentication") for more information and some examples.
    - **Matrix**: to define the authentication methods that will be required to successfully authenticate the user. Each row indicates the first authentication method, and each column indicates the second factor to use.
- **Always ask for credentials:** if checked (the selected value is Yes), the IdP will always request credentials from users who meet the condition defined in this rule.
- **Register OTP when required:** if it is checked (selected value is Yes), Soffid will allow registering the OTP to users who meet the condition and do not have one previously.
- **Kerberos domain**: allows you to pick up a file to configure the Kerberos authentication method. For more information, you can visit the [How to enable Kerberos authentication page](https://bookstack.soffid.com/books/federation/page/how-to-enable-kerberos-authentication "How to enable kerberos authentication").

##### Advanced Authentication

- **Allow user to recover password**: if it is checked (selected value is Yes), and the password recovery addon is installed, the user will be allowed to execute the password recovery mechanism.
- **Register OTP when required:** if it is checked (selected value is Yes), Soffid will allow to register the new OTP to the user during the login process.
- **Allow user to self-register**: if it is checked (selected value is Yes), the user will be allowed to register itself. This option sends an email to the user to verify the email address is correct, and then lets the user to enter a new password. 
    - **Registration process:** workflow selected to create the new identity.
    - **User Type**: identifies the password policy that is to be applied. More information on this link [User Type.](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/user-type "User Type")
    - **Primary Group**: select which organization unit this user belongs to.
- **Register identities identified by external IdPs**: allows Soffid IdP to automatically register a new identity when a user authenticates with a third-party IdP, and this identity does not exist yet in Soffid database. Furthermore, at the third party IdP configuration page, one can tune how this identity is going to be created.
- **Store last user name in browser**: allows the browser to save the last user name when Yes is selected.
- **Enable reCaptcha v3 service**: *(\*)* helps to keep save your website. You can enable it by selecting the Yes option. When you select the Yes option, you must fill in the following fields:   
    
    - **Captcha site key**: this key is used to invoke the reCAPTCHA service
    - **Captcha site secret**: the secret key to communicate your web site with reCAPTCHA service. This secret key authorizes the communication.
    - **Captcha threshold (1 for highest confidence, 0 for low confidence)**:

##### Profiles

A profile is a protocol or subset of protocols implemented by the Identity Provider. There are some accepted protocols, those allows a custom config dependent on the selected profile.

<p class="callout info">You can visit the [Profiles chapter](https://bookstack.soffid.com/books/federation/chapter/profiles) for more information about each one.</p>

##### Look and feel

Soffid allows you to personalize your login page by adding some style elements, as well as header and footer elements.

- **Logo**: this logo will be displayed for user in Windows desktop.
- **CSS Style**: allows you to add a CSS style for your login page.
- **Html header**: allows you to add an Html header.
- **Html footer**: allows you to add an Html footer.
- **Language (2 characters code)**

#### External SAML IdP

##### Identification

- **publicID**: unique name to identify the identity provider.
- **Name**: friendly user name.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

##### Service Configuration

- **Metadata**: the Metadata for an Identity Provider defines how this Identity Provider delivers its service: 
    - Which security algorithms does it support.
    - The public portion of it's signing and encrypting keys.
    - The SAML protocols does it support.
    - The URL of each SAML protocol endpoint.
    - Contact information.

The Metadata is the information that any application need to use the IdP. That is an XML file that contains the public encryption keys and the services provided

Leave it blank as Soffid IdP will fulfill it for you.

##### Login Rules

- **User regular expression**: regular expression to detect users of this identity provider.
- **Login hint script**: script to help to login. Return the text to help.
- **Identity provisioning script**: script to bind or register a new identity. Return the user name of the owner identity for the authenticated account.

#### OpenID-Connect

##### Service Configuration

- **Metadata**: there are some required parameters: 
    - **authorization\_endpoint**: contains the oAuth endpoint to forward the user to get the authorization token.
    - **token\_endpoint**: contains the oAuth endpoint to get the access token, based on the authorization token got at previous step.
    - **userinfo\_endpoint**: if remote IdP is OpenID-connect compliant, the token endpoint should have sent an access token along a JWT OpenID token containing user claims. If this is not the case, Soffid will use this user\_info endpoint to fetch user claims. This mechanism is needed for oAuth2 servers.
    - **scopes\_sopported**: The list of scopes specified here will be used at first step, when redirecting the user to the authorization endpoint.

<table border="0" id="bkmrk-%C2%A0-%7B-%22authorization_e" style="width: 100%; border-collapse: collapse;"><tbody><tr><td style="width: 3.58022%; border-style: none;">  
</td><td style="width: 87.2838%; border-style: none;">```
{
    "authorization_endpoint": "https://server/oauth2/auth",
    "token_endpoint": "https://server/oauth2/token",
    "userinfo_endpoint": "https://server/oauth2/userinfo",
    "scopes_supported": [ "openid","email","profile"]
}
```

</td><td style="width: 9.13577%; border-style: none;">  
</td></tr></tbody></table>

- **oAuth key**: is the identificator token generated by the oAuth server.
- **oAuth secret**: is the secret generated by the oAuth server.

The Metadata is the information that any application need to use the IdP. That is an XML file that contains the public encryption keys and the services provided

##### Login rules

- **User regular expression**: regular expression to detect users of this identity provider.
- **Login hint script**: script to help to login. Return the text to help.
- **Identity provisioning script**: script to bind or register a new identity. Return the user name of the owner identity for the authenticated account.

<table border="1" id="bkmrk-%C2%A0-sn-%3D-attributes%7B%22s" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 2.83947%; border-style: none;">  
</td><td style="width: 89.753%; border-style: none;">```Java
sn = attributes{"screen_name"};
i = sn.indexOf(" ");
if (i> 0) {
	user.firstName = sn.substring(0, i);
	user.lastName = sn.substring(i+1);
} else {
	user.firstName = "?";
  	user.lastName = sn;
}
return attributes{"name"};
```

</td><td style="width: 7.40737%; border-style: none;">  
</td></tr></tbody></table>

#### Facebook

##### Identification

- **publicID**: unique name to identify the identity provider. Soffid will fulfill wint the Facebook URL.
- **Name**: friendly user name.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

##### Service Configuration

- **Click here to obtain a client id and client secret**: allows you to get the oAuth key and secret.
- **oAuth key**: is the identificator token generated by the oAuth server.
- **oAuth secret**: is the secret generated by the oAuth server.

##### Login rules

- **User regular expression**: regular expression to detect users of this identity provider.
- **Login hint script**: script to help to login. Return the text to help.
- **Identity provisioning script**: script to bind or register a new identity. Return the user name of the owner identity for the authenticated account.

#### Google

##### Identification

- **publicID**: unique name to identify the identity provider. Soffid will fulfill wint the Google URL.
- **Name**: friendly user name.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

##### Service Configuration

- **Click here to obtain a client id and client secret**: allows you to get the oAuth key and secret.
- **oAuth key**: is the identificator token generated by the oAuth server.
- **oAuth secret**: is the secret generated by the oAuth server.

##### Login rules

- **User regular expression**: regular expression to detect users of this identity provider.
- **Login hint script**: script to help to login. Return the text to help.
- **Identity provisioning script**: script to bind or register a new identity. Return the user name of the owner identity for the authenticated account.

#### Linkedin

##### Identification

- **publicID**: unique name to identify the identity provider. Soffid will fulfill wint the Linkedin URL.
- **Name**: friendly user name.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

##### Service Configuration

- **Click here to obtain a client id and client secret**: allows you to get the oAuth key and secret.
- **oAuth key**: is the identificator token generated by the oAuth server.
- **oAuth secret**: is the secret generated by the oAuth server.

##### Login rules

- **User regular expression**: regular expression to detect users of this identity provider.
- **Login hint script**: script to help to login. Return the text to help.
- **Identity provisioning script**: script to bind or register a new identity. Return the user name of the owner identity for the authenticated account.

---

[*(\*) What is CAPTCHA --&gt; https://support.google.com/a/answer/1217728?hl=en*](https://support.google.com/a/answer/1217728?hl=en)

*[(\*) ](https://support.google.com/a/answer/1217728?hl=en)https://www.google.com/recaptcha/about/*

# Service Provider

### Definition

The Service Providers are standard applications that rely on Identity Providers to let the users log in.

#### Join federation

To join the federation, the service provider management team must deliver its "Metadata". The service provider Metadata describes how the service providers behave:

- Which security algorithms does it support.
- The public portion of its signing and encrypting keys.
- The SAML protocol does it support.
- The URL of each SAML protocol endpoint.
- Contact information.

### Standard attributes

<p class="callout info">To see more information about the service providers types and attributes, you can check the [Service providers](https://bookstack.soffid.com/books/soffid-4-reference-guide/page/service-providers-addon-federation "Service Providers (addon federation)") page.</p>

# Virtual Identity Provider

### Definition

A single identity provider usually offers different profiles or service levels to diffeferent service provider. To be able to define this behavior, any Identity Provider can be split into many virtual identity providers. Those identity providers will be served by the same actual identity provider, but they will have different profile configurations.

### Standard attributes

#### Identification

- **publicID**: unique name to identify the identity provider.
- **Name**: user friendly name to identify the identity provider.
- **Organization**: company name of the external IdP.
- **Contact**: email address of the external IdP.

#### Service configuration

- **Metadata**: the Metadata for an Identity Provider defines how this Identity Provider delivers its service: 
    - Which security algorithms does it support.
    - The public portion of it's signing and encrypting keys.
    - The SAML protocols does it support.
    - The URL of each SAML protocol endpoint.
    - Contact information.

Leave it blank as Soffid IdP will fulfill it for you.

#### SAML Security

- **Public key**: 
    - **Generate public/private key**: 
        - **Delete public/private key**: allows you to delete the public/private key generated previously.
        - **Generate PKCS10**: generates a PKCS10 file (Certification request standard)
    - **Upload PKCS12 file**: allows you to upload a PKCS#12 file. That file must contain the private and public kesus and the server certificate as weel. Mind that PKCS#12 file use to be protected by a PIN.
- **Certificate chain**: text certificate chain created with one of the previous options.


#### Authentication

- **Authentication methods**: matrix to define the authentication methods that will be required to successfully authenticate the user. Each row indicates the first authentication method, and each column indicates the second factor to use.
- **Adaptive authentication**: that option allows you to add additional authentication matrix which will be run when the condition defined was comply. 
    - **Description**: rule description to identify it.
    - **Condition**: script to enable that rule. The result of the rule must be true or false. There are some available vars to create the condition. You can visit the [Condition for Adaptive authentication page](https://bookstack.soffid.com/books/federation/page/condition-for-adaptive-authentication "Condition for Adaptive authentication") for more information and some examples.
    - **Matrix**: to define the authentication methods that will be required to successfully authenticate the user. Each row indicates the first authentication method, and each column indicates the second factor to use.

#### Advances authentication

- **Allow user to recover password**: if it is checked (selected value is Yes), and the password recovery addon is installed, the user will be allowed to execute the password recovery mechanism.
- **Allow user to self-register**: if it is checked (selected value is Yes), the user will be allowed to register itself. This option sends an email to the user to verify the email address is correct, and then lets the user to enter a new password.
- **Registet identities identified by external IdPs**: allows Soffid IdP to automatically register a new identity when a user authenticates with a third-party IdP, and this identity does not exist yet in Soffid database. Furthermore, at the third party IdP configuration page, one can tune how this identity is going to be created.

#### Profiles

A profile is a protocol implemented by the Identity Provider. There are some accepted protocols, those allows a custom config dependent on the selected profile

- OpenIDProfile
- SAML1ArtifactResolutionProfile
- SAML1AttributeQueryProfile
- SAML2ArtifactResolutionProfile
- SAML2AttributeQueryProfile
- SAML2ECPProfile
- SAML2SSOProfile

<p class="callout info">You can visit the [Profiles chapter](https://bookstack.soffid.com/books/federation/chapter/profiles)<span style="background-color: #d3efff; color: #01466c;"> for more information about each one.</span></p>

#### Service Providers

It will be necessary to bind any service provider to the virtual identity provider. When no such bind exists for a service provider, the actual identity provider profile configuration applies.

# Profiles



# Profiles

## Description

<p class="callout success">A profile is a protocol or subset of protocols implemented by the Identity Provider. There are some accepted protocols, those allows a custom config dependent on the selected profile.</p>

The accepted protocols are the following:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> [OpenIDProfile](https://bookstack.soffid.com/books/federation/page/openidprofile "OpenIDProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> [SAML1ArtifactResolutionProfile](https://bookstack.soffid.com/books/federation/page/saml1artifactresolutionprofile "SAML1ArtifactResolutionProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> [SAML1AttributeQueryProfile](https://bookstack.soffid.com/books/federation/page/saml1attributequeryprofile "SAML1AttributeQueryProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> [SAML2ArtifactResolutionProfile](https://bookstack.soffid.com/books/federation/page/saml2artifactresolutionprofile "SAML2ArtifactResolutionProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> [SAML2AttributeQueryProfile](https://bookstack.soffid.com/books/federation/page/saml2attributequeryprofile "SAML2AttributeQueryProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> [SAML2ECPProfile](https://bookstack.soffid.com/books/federation/page/saml2ecpprofile "SAML2ECPProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.</span> [SAML2SSOProfile](https://bookstack.soffid.com/books/federation/page/saml2ssoprofile "SAML2SSOProfile")

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8.</span> [CAS](https://bookstack.soffid.com/books/federation/page/cas)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">9.</span> [Radius](https://bookstack.soffid.com/books/federation/page/radius)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">10.</span> Tacacs+

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">11.</span> Ws-Federation

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">12.</span> Shared signals &amp; events

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">13.</span> [Esso](https://bookstack.soffid.com/books/federation/page/esso)

## Screen overview

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2024-09/scaled-1680-/XvjN1I1K1bTKb77c-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-09/XvjN1I1K1bTKb77c-image.png)

When an identity provider is created, by default, all the profiles appear disabled (the profile is displayed strikethrough). It will be necessary to config one by one depending on your company needs. To config a profile you must click on the proper profile, and Soffid will display a new window to config it.

## Actions

<table border="1" id="bkmrk-add-or-remove-column"><tbody><tr><td style="width: 191px;">**Open profile**

</td><td style="width: 606px;">If you click on a row of the profile list, Soffid will display a modal window with the data and configuration of the profile selected.

</td></tr></tbody></table>

# OpenIDProfile

## Definition

The Identity Provider will serve the OpenID-Connect protocol. It is possible to accept the default endpoints or modify them.

You can check the server features visiting [https://&lt;YOUR-IdP&gt;/.well-known/openid-configuration](https://<YOUR-IdP>/.well-known/openid-configuration). That JSON gives you information about the oAuth authentication types allowed, the key URL, the soported authentication methods and the info about the endpoints defined.

<p class="callout info">You can download an example [openid-configuration.json](https://bookstack.soffid.com/attachments/29)</p>

## Screen overview

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2026-08/scaled-1680-/W1Dzjoej57iRn4KC-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2026-08/W1Dzjoej57iRn4KC-image.png)

## Standard attributes

- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Discovery endpoint**: call this endpoint to request the OpenID-Connect provider metadata.
- **Authorization endpoint**: call this endpoint to request or authorization grant.
- **Token endpoint**: call this endpoint to get the token or to renew the token.
- **User info endpoint**: call this endpoint to request user information.
- **Revoke endpoint:** call this endpoint when you finish and do not need more use the token.
- **Max logins per user and minute**: limits the number of requests a user can make to an OpenID Connect service provide. Check the new feature [2026-07-20 New feature: configure maximum openid logins](https://bookstack.soffid.com/books/soffid-4-reference-guide/page/2026-07-20-new-feature-configure-maximum-openid-logins "2026-07-20 New feature: configure maximum openid logins").
- **Logout endpoint**: call this endpoint to close the session with the service provider

# SAML1ArtifactResolutionProfile

## Definition

Based on SAML version 1 standard. This profile is used when the Service Provider wants to resolve or check a received assertion.

<span style="color: #222222; font-size: 2.8275em; font-weight: 400;">Screen overview</span>

[![image-1638533916859.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638533916859.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638533916859.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Sign Responses**:​ usually it can be set to never, as long as the assertions are signed. Its preferable to sign assertions rather than responses, because the assertion can be forwarded by the service provider to another service provider, but the response not.
- **Sign Assertions**: it's advisable to sign every assertion, so it avoids assertion spoofing. The assertion can be forwarded by the service provider to another service provider.
- **Sign Request**: the identity provider will issue requests to service providers in order to perform the single logout process. Unless it is needed by any service provider, leave it to conditional.

# SAML1AttributeQueryProfile

## Definition

Based on SAML version 1 standard. This profile is used when the SSOProfile does not include attributes statements in the assertion. This profile allows to the applications request user data.

When you are configuring the profile, you could define what data will be encrypted and signed.

## Screen overview

[![image-1638533961155.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638533961155.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638533961155.png)

<span style="color: #222222; font-size: 2.8275em; font-weight: 400;">Standard attributes</span>

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Sign Responses**:​ usually it can be set to never, as long as the assertions are signed. Its preferable to sign assertions rather than responses, because the assertion can be forwarded by the service provider to another service provider, but the response not.
- **Sign Assertions**: it's advisable to sign every assertion, so it avoids assertion spoofing. The assertion can be forwarded by the service provider to another service provider.
- **Sign Request**: the identity provider will issue requests to service providers in order to perform the single logout process. Unless it is needed by any service provider, leave it to conditional.
- **Outbound Artifact Type**: defaults to 4. Any other value is not supported. For more information, see SAML specification.
- **Assertion** **Lifetime**: specifies the validity period for the generated assertions . The time period is specified using the ISO 8601 notation. The standard format follows the pattern: PnYnMnDTnHnMnS.

Assertion Lifetime examples:

- PT5M sets a duration of five minutes.
- PT1H30M sets a duration of one hour and a half.
- P3Y6M4DT12H30M5S" sets a duration of three years, six months, four days, twelve hours, thirty minutes, and five seconds.

---

*[https://en.wikipedia.org/wiki/ISO\_8601 ](https://en.wikipedia.org/wiki/ISO_8601)*

[*http://saml.xml.org/saml-specifications*](http://saml.xml.org/saml-specifications)

# SAML2ArtifactResolutionProfile

## Definition

Based on SAML version 1 standard. This profile is used when the Service Provider wants to resolve or check a received assertion. The profile configuration settings are quite similar to those present in SAML2SSOProfile.

When you are configuring the profile, you could define what data will be encrypted and signed.

## Screen overview

[![image-1638534011855.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638534011855.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638534011855.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Sign Responses**:​ usually it can be set to never, as long as the assertions are signed. Its preferable to sign assertions rather than responses, because the assertion can be forwarded by the service provider to another service provider, but the response not.
- **Sign Assertions**: it's advisable to sign every assertion, so it avoids assertion spoofing. The assertion can be forwarded by the service provider to another service provider.
- **Sign Request**: the identity provider will issue requests to service providers in order to perform the single logout process. Unless it is needed by any service provider, leave it to conditional.
- **Encrypt Assertions**: is a desired feature, but some service providers, mainly public cloud service providers do not support it. Thus, the default value is to never encrypt, but you can set it to optional or always as needed. 
    - If you set it to optional and the public key of the service provider who is going to receive the assertion is available, it will be used to encrypt it.
    - If you set it to never, it will not ever be encrypted in any case.
    - If you set it to always, but the remote service provider encryption key is unknown, an exception will be raised.
- **Encrypt NameIds**: should be let to never.

# SAML2AttributeQueryProfile

## Definition

Based on SAML version 1 standard. This profile is used when the SSOProfile does not include attributes statements in the assertion. This profile allows to the applications request user data.

When you are configuring the profile, you could define what data will be encrypted and signed.

## Screen overview

[![image-1638534055413.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638534055413.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638534055413.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Sign Responses**: usually it is set to conditional or always, so as the service provider can verify the response authenticity.
- **Sign Assertions**: is usually set to never, as long as the response is already signed.
- **Sign Request**: not used, as the service provider will not need to generate requests.
- **Outbound Artifact Type:** usually kept in blank, unless you are using old SAML 1 service.
- **Assertion Lifetime:** specifies the validity period for the generated assertions. The time period is specified using the ISO 8601 notation. The standard format follows the pattern: PnYnMnDTnHnMnS. This means that PT5M sets a duration of five minutes. For instance, PT1H30M sets a duration of one hour and a half.
- **Encrypt Assertions**: is a desired feature, but some service providers, mainly public cloud service providers do not support it. Thus, the default value is to never encrypt, but you can set it to optional or always as needed. 
    - If you set it to optional and the public key of the service provider who is going to receive the assertion is available, it will be used to encrypt it.
    - If you set it to never, it will not ever be encrypted in any case.
    - If you set it to always, but the remote service provider encryption key is unknown, an exception will be raised.
- **Encrypt NameIds**: should be let to never.
- **Assertion Proxy Count**: sets the maximum number of hops that can be accepted for any assertion. A number of 0 does not set any limit.

# SAML2ECPProfile

## Definition

The Enhanced Client Profile is used when the Service Provider is not a web application. Nowadays, it is rarely used, as most mobile applications have shifted to OAuth or OpenIDConnect.

When you are configuring the profile, you could define what data will be encrypted and signed.

## Screen overview

[![image-1638534117678.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638534117678.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638534117678.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enable.
- **Sign Responses**:​ usually it can be set to never, as long as the assertions are signed. Its preferable to sign assertions rather than responses, because the assertion can be forwarded by the service provider to another service provider, but the response not.
- **Sign Assertions**: it's advisable to sign every assertion, so it avoids assertion spoofing. The assertion can be forwarded by the service provider to another service provider.
- **Sign Request**: the identity provider will issue requests to service providers in order to perform the single logout process. Unless it is needed by any service provider, leave it to conditional.
- **Encrypt Assertions**: is a desired feature, but some service providers, mainly public cloud service providers do not support it. Thus, the default value is to never encrypt, but you can set it to optional or always as needed. 
    - If you set it to optional and the public key of the service provider who is going to receive the assertion is available, it will be used to encrypt it.
    - If you set it to never, it will not ever be encrypted in any case.
    - If you set it to always, but the remote service provider encryption key is unknown, an exception will be raised.
- **Encrypt NameIds**: should be let to never.
- **Assertion Proxy Count**: sets the maximum number of hops that can be accepted for any assertion. A number of 0 does not set any limit
- **Include Attribute Statement**: 
    - - If the attribute statements are included (selected value is Yes), that is the user attributes are included on the response the performance is increased as this additional step is no longer needed. It is particularly recommended when using public cloud service providers.
        - If attribute statements are not included (selected value is No), the service provider will receive the SAML assertion with the principal name, then the service provider will issue a attribute statement request to the service provider to get them.
- **Locality DNS Name**

# SAML2SSOProfile

## Definition

This is the most commonly used SAML profile. It allows the IdP to identify users and to give such information to Service Providers. This profile is used to log in.

When you are configuring the profile, you could define what data will be encrypted and signed.

## Screen overview

[![image-1638534204054.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1638534204054.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1638534204054.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enabled.
- **Sign Responses**:​ usually it can be set to never, as long as the assertions are signed. Its preferable to sign assertions rather than responses, because the assertion can be forwarded by the service provider to another service provider, but the response not.
- **Sign Assertions**: it's advisable to sign every assertion, so it avoids assertion spoofing. The assertion can be forwarded by the service provider to another service provider.
- **Sign Request**: the identity provider will issue requests to service providers in order to perform the single logout process. Unless it is needed by any service provider, leave it to conditional.
- **Outbound Artifact Type**: usually kept in blank, unless you are using old SAML 1 service.
- **Encrypt Assertions**: is a desired feature, but some service providers, mainly public cloud service providers do not support it. Thus, the default value is to never encrypt, but you can set it to optional or always as needed. 
    - If you set it to optional and the public key of the service provider who is going to receive the assertion is available, it will be used to encrypt it.
    - If you set it to never, it will not ever be encrypted in any case.
    - If you set it to always, but the remote service provider encryption key is unknown, an exception will be raised.
- **Encrypt NameIds**: should be let to never.
- **Assertion Proxy Count**: sets the maximum number of hops that can be accepted for any assertion. A number of 0 does not set any limit
- **Include Attribute Statement**: 
    - If the attribute statements are included (selected value is Yes), that is the user attributes are included on the response the performance is increased as this additional step is no longer needed. It is particularly recommended when using public cloud service providers.
    - If attribute statements are not included (selected value is No), the service provider will receive the SAML assertion with the principal name, then the service provider will issue a attribute statement request to the service provider to get them.

# CAS

## Definition

Cas protocol is rarely used.

## Screen overview

[![image-1661330455520.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661330455520.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661330455520.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (the selected option is Yes) that protocol will be enabled.

# Radius

## Definition

Networking protocol that authorizes and authenticates users who access a remote network.

## Screen overview

[![image-1661330603198.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661330603198.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661330603198.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enabled.
- **Authentication port**: UDP authentication port. This port is used to log in.
- **Accounting port**: UDP authentication port. This port is used to manage the session, when the session starts and when finishes.
- **Enable PAP (unsecure)**: authentication protocol. The password to send is unencrypted.
- **Enable CHAP**: authentication protocol. The password to send is encrypted.
- **Enable MS CHAP v2**: authentication protocol.

# ESSO

## Definition

Here is an explanation about how to configure the ESSO profile by using Soffid as Identity Provider.

<p class="callout info">Please note that the profile parameters will be automatically updated on the PCs.</p>

## Screen overview

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2024-10/scaled-1680-/MdAnpxT99fDQPpaY-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-10/MdAnpxT99fDQPpaY-image.png)

## Standard attributes

- **Class**: class name (readOnly field).
- **Enabled**: if it is checked (selected option is Yes) that protocol will be enabled.
- **Soffid main agent**: main agent to check the user account.
- **Seconds to send keep alive from desktop to server**:
- **Timeout to close sessions**:
- **Enable Windows credential provider**: if it is checked (selected option is Yes), the soffid logo will be displayed.
- **Display last logged-on user**: if it is checked (selected option is Yes), the last logged-on user will be displayed.
- **Create local accounts when there is no domain account**: if checked (the selected option is Yes) and the account does not exist in the main Soffid agent, the account is created as a local machine user.
- **Let user login as a shared account:** PAM Desktop
- **Maximum number of consecutive days to allow an off-line logon**: the maximum value is 30 days.
- **Enforce ESSO session when desktop gets on-line**: if it is checked (selected option is Yes), the authentication is forced when the connection is retrieved
- **Enforce ESSO sessions**: if it is checked (selected option is Yes), performs authentication against the Windows domain without logging into Soffid.
- **Let the user close the ESSO session**: allow the user to log out from ESSO
- **Allow quickly (and insecure) switch between users**: if it is checked (selected option is Yes),
- **Hostname format**
- **Label for standard login**: label to be displayed for standard user in Windows desktop.
- **Label for administrator login**: label to be displayed for adminsitrator user in Windows desktop.

## Configuration

Once you have configured the Esso profile you must add an Adaptive authentication rule.

<p class="callout info">For more information, visit [the Condition for Adaptive authentication page.](https://bookstack.soffid.com/books/federation/page/condition-for-adaptive-authentication)</p>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2024-09/scaled-1680-/b3cBiTezEfctVmJk-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-09/b3cBiTezEfctVmJk-image.png)

# Condition for Adaptive authentication

## Introduction

Adaptive authentication is designed to improve the security of online accounts by adding an additional layer of protection against unauthorized access.

When the authentication is being defined, Soffid allows you to add some **adaptive authentications** in addition to the Authentication methods. Those adaptive authentications will be evaluated, and when the result of the condition will be true, the rule will be enabled.

## Screen overview

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-04/scaled-1680-/V0qafkpzfJfb3BQq-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-04/V0qafkpzfJfb3BQq-image.png)

## Standard attributes

#### Description

Description to identify the rule

#### Condition

Allows you to write a script validation, with the result true or false. To develop the script you can use some vars defined to that:

There are some available vars to create the condition:

- **currentAuthenticationMethod**: return tue current authentication method. Check the [Authentication methods available](#bkmrk-authentication-metho).
- **dayOfWeek**: number of the day of the week (1-7 where 1 is Sunday and 7 is Saturday).
- **daysSinceLastLogon**: number of days (integer).
- **daysSinceLastLogonByMethod**: return a hashmap with the logon method and the number of days (integer). Check the [Authentication methods available](#bkmrk-authentication-metho).
- **daysSinceLastLogonFromSameHost**: number of days (integer).
- **deviceCertificate**: is or is not a device certificate (boolean).
- **displacement**: distance in kilometers (Double).
- **displacementSpeed**: distance in kilometers since last login attempt (Double).
- **failuresForSameIp**: integer value to determine the number of failures.
- **failuresForSameUser**: integer value to determine the number of failures.
- **failuresRatio**: value between 0 and 1.
- **geoInformation**: it is an object that contains:
    
    
    - ip (string)
    - date (Date)
    - country (string)
    - countryDivision1 (string)
    - countryDivision2 (string)
    - city (string)
    - latitude (Double)
    - longitude (Double)
    - accuracy (Double): accuracy in kilometers.
    - domain (string)
    - isp (string)
    - userType (string)
    - anonymous (Double): what is the probability that they use an anonymizer?: 
        - &gt; 0.5 =&gt; anonymizer
        - &lt; 0.5 =&gt; end user
- **hasCertificate**: the user has or does not have a certificate (boolean).
- **hasFidoToken**: the user has or does not have a Fido token (boolean).
- **hasOtp**: the user has or does not have an OTP (boolean).
- **hasOtpHotp**: the user has or does not have an OTP based on events (boolean).
- **hasOtpMail**: the user has or does not have an email OTP(boolean).
- **hasOtpPin**: the user has or does not have a Pin OTP (boolean).
- **hasOtpSms**: the user has or does not have an SMS OTP (boolean).
- **hasOtpTotp**: the user has or does not have an OTP based on time (boolean).
- **hasPushToken**: the user has or does not have a Push Token (boolean).
- **hasToken**: the user has or does not have a Token (boolean).
- **hour**: integer value between 0 and 23.
- **identityProvider**: string value with the name of the identity provider.
- **ipAddress**: string with the IP address.
- **isEsso**: return true if the login is done through ESSO.
- **minute**: integer value between 0 and 59.
- **newDevice**: boolean value (true or false). It validates if the connection is from a new device.
- **remoteHost**: it is a host object.
- **sameCountry**: boolean value (true or false). It validates if the connection is from the same country as the last user connection.
- **serviceProvider**: string value with the name of the service provider.
- **sourceCountry**: sting value to identify the country. <span style="color: #000000;">It uses the first two ISO characters.</span>
- <span style="color: #000000;">**user**: it is a user object.</span>

##### Authentication methods available: 

- **P**: Password
- **K**: Kerberos
- **E**: Broker
- **O**: OTP
- **M**: Email
- **S**: SMS
- **I**: PIN
- **C**: Certificate
- **F**: Finger print
- **Z**: Push

#### Matrix

To define the authentication methods that will be required to successfully authenticate the user. Each row indicates the first authentication method, and each column indicates the second factor to use.

#### Always ask for credentials

Use this option to force the request for credentials when the user meets the defined condition.

#### Register OTP when required

Use this option to allow the user to register the OTP the first time he/she attempts to log in when the user meets the defined condition.

## Actions

<table border="1" id="bkmrk-apply-changes-allow-"><tbody><tr><td style="width: 157px;">**Apply changes**</td><td style="width: 652px;">Allows you to save the data of a new adaptive authentication or to update the data of the previously created adaptive authentucation.

</td></tr><tr><td style="width: 157px;">**Add**

</td><td style="width: 652px;">Allows you to add a new adaptive authentication. When you click the add button (+) Soffid will display new fields to fill in. For each adaptive authentication you must fulfill the description, the condition to evaluate and the matrix which will be enable when the condition will be true.

Then you must click on the "Apply changes" button to save the data.

</td></tr><tr><td style="width: 157px;">**Delete**

</td><td style="width: 652px;">Allows you to remove one by one the adaptive authentication defined. You must click on the trash icon the account of the proper rule. Then you must click the "Apply changes" button to save the data.

</td></tr><tr><td style="width: 157px;">**Up**

</td><td style="width: 652px;">Allows you to reorder (up) the defined adaptive authentication.

</td></tr><tr><td style="width: 157px;">**Down**

</td><td style="width: 652px;">Allows you to reorder (down) the defined adaptive authentication.

</td></tr></tbody></table>

## Examples

##### Rule 1

```shell
failuresRatio > 0.8
```

##### Rule 2

```
(daysSinceLastLogon > 10) && (ipAddress.startsWith("192.168.")
```

##### Rule 3

```shell
((dayOfWeek == 7) || (dayOfWeek == 1)) &&  (user!=null && "<USER_NAME>".equals(user.userName))
```

##### Rule 4

```
"ES".equals(sourceCountry) || ipAddress.startsWith("192.168.")
```

##### Rule 5

```
isEsso
```

##### Rule 6

```
if (daysSinceLastLogonByMethod["PO"] == null || daysSinceLastLogonByMethod["PO"] > 30) 
   return true;
```

##### Rule 7

```
"YOUR_SERVICE_PROVIDER".equals(serviceProvider)
```

##### Rule 8

```
"P".equals(currentAuthenticationMethod)
```

##### Rule 9

```
if (user!=null) 
  log.info("**** User  " + user.userName);
user!=null && "Ada".equals(user.userName);
```

# How to deploy the identity & service provider



# How to deploy the identity & service provider

## Step-by-step

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>To deploy the identity provider is advisable to install a dedicated sync server. It can be configured as a proxy sync server as it does not need direct access to Soffid database. Instead, it will connect to main sync servers to get users and federation information. Also, you can deploy the identity provider in your existing sync.

<p class="callout info">To install a proxy sync server follow the instructions at the [Install sync server page](https://bookstack.soffid.com/link/28#bkmrk-install-next-sync-se). </p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> If the installation is in a **dedicated Sync server:**

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.1.</span> You need open the Sofid Console and approve the Task to accept the new Sync server.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-11/embedded-image-8kpmkcdb.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.1.</span> You need tune the **Sync server memory usage.**

`Main Menu > Administration > Configure Soffid > Integration engine > Synchronization servers`

![](https://bookstack.soffid.com/uploads/images/gallery/2021-11/embedded-image-gnlykqrl.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span>Once the Sync server is registered, if you want to create a **Soffid IdP** you must create a new **Identity Provider Agent**.

`<span class="link" id="bkmrk-main-menu">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0"> > </span><span class="link" id="bkmrk-administration">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-0"> > </span><span class="link" id="bkmrk-configure-soffid">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-1"> > </span><span class="link" id="bkmrk-integration-engine">Integration engine</span><span id="bkmrk-%C2%A0%3E%C2%A0-2"> > </span><span id="bkmrk-agents">Agents</span>`

- **Type**: Soffid Identity Provider.
- **Server**: select the sync server that will host the identity provider.
- **Trust password**: must be unchecked.
- **Read only**: must be unchecked.
- **Manual account creation**: usually is unchecked, but could be useful to check it during initial tests.
- **Role based**: usually is unchecked, despite it could be used to limit the users that can use it.
- **Groups**: select the groups that can use it. Leave it blank to allow any user.
- **User domain**: use default users domain. Nevertheless, depending on your needs, creating another user domain could be a good option.
- **Password domain**: use default password domain.
- **User types**: check the user types that can use the identity provider.
- **Public ID**: enter the public ID assigned in the federation management page.

Your identity provider agent should look like this one:

![](https://bookstack.soffid.com/uploads/images/gallery/2021-11/embedded-image-x71vc4gk.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>Upload the **Federation addon** to the Soffid Console:

<p class="callout info">To upload the addon follow the instructions at the [How to install Federation in Soffid page](https://bookstack.soffid.com/books/federation/page/how-to-install-federation-in-soffid "How to install Federation in Soffid").</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5. </span>Once you are connected to the Soffid console, you can start creating an **Entity Group**.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.1. </span>First of all, open the **Identity &amp; Service providers** page

`<span class="link" id="bkmrk-main-menu-0">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0-3"> > </span><span class="link" id="bkmrk-administration-0">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-4"> > </span><span class="link" id="bkmrk-configure-soffid-0">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-5"> > </span><span class="link" id="bkmrk-web-sso">Web SSO</span><span id="bkmrk-%C2%A0%3E%C2%A0-6"> > </span><span id="bkmrk-identity-%26-service-p">Identity & Service providers</span>`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.2. </span>Then, click the "Add group" button and Soffid will display a new window to fill in the **Entity group** attributes.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.3. </span>Once you fill in the fields, you need to save (disk button) or apply changes (Apply changes button) to save the data.

When the Entity Group is created, inside there will be two options, one to create the Identity Providers and other to create the Service Providers.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-brc4ake0.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.3.1. </span>Clicking on the Identity Providers record a identity providers list will be displayed and it will be able to create new identity providers. To create a new Identity Provider continue on step 5rd.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.3.2. </span>Clicking on the Service Providers record a service provider list will be displayed and it will be able to create new service providers. To create a new Service Provider continue on step 6th.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> New **Identity Provider:**

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.1.</span> To create a new Identity Provider you can click on the "Add identity provider" button on the tree view, or click the add button (+) on the Identity Provider list. Then Soffid will display a new window.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.2. </span>At the new window you must select the IdP type you want to create and fill in the required fields. The fields to full fill depend on the IdP type selected.

- - You can visit the [Identity Provider page ](https://bookstack.soffid.com/books/federation/page/identity-provider)for more detail.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.2.1. </span>When creating a Soffid identity provider, it will be mandatory to create an agent. The agent will have to be a Soffid Identity Provider agent. On the connector parameters you must define a unique *Public ID* which will be used on the Identity Provider configuration.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-10/embedded-image-njprxtyw.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.3.</span> Once you fill in all the data, you need to enable the proper profiles by clicking on the profile list and configuring them.

- - You can fin more information visiting the[ Profile page](https://bookstack.soffid.com/books/federation/page/profiles "Profiles") where the available protocols are defined.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.4.</span> Finally, you need to save (disk button) or apply changes (Apply changes button) to save the data.

<p class="callout warning">Note that in some cases it will be necessary to **restart the synchronization server**, so Soffid will generate the additional metadata or certificate data needed.</p>

<p class="callout warning">Note that you may have to **open the standard port**.</p>

**Soffid Identity Provider Screenshot**

[![image-1691748396068.png](https://bookstack.soffid.com/uploads/images/gallery/2023-08/scaled-1680-/image-1691748396068.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-08/image-1691748396068.png)

[![image-1691748424764.png](https://bookstack.soffid.com/uploads/images/gallery/2023-08/scaled-1680-/image-1691748424764.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-08/image-1691748424764.png)

##### You could check your Identity Provider

```
https://<YOUR_SYNCSERVER_HOSTNAME>:1443/protected
```

For instance: https://iam-sync-idp.soffidnet:1443/protected

##### You could view your IdP metadata

```
https://<YOUR_SYNCSERVER_HOSTNAME>:1443/SAML/metadata.xml
```

For instance: https://iam-sync-idp.soffidnet:1443/SAML/metadata.xml

##### In addition, the complete metadata of soffid

```
https://<YOUR_SYNCSERVER_PRINCIPAL>:1760/SAML/metadata.xml
```

For instance: https://iam-sync.soffidnet:1760/SAML/metadata.xml

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.</span> New **Service Provider:**

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.1.</span> To create a new Service Provider you can click on the "Add service provider" button on the tree view, or click the add button (+) on the Service Provider list. Then Soffid will display a new window.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.2. </span>At the new window you must select the Service provider type you want to create and fill in the required fields. The fields to full fill depend on the IdP type.

- - You can visit the [ Service Provider page ](https://bookstack.soffid.com/books/federation/page/service-provider)for more detail.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.3.</span> One you fill in all the data, you need to save (disk button) or apply changes (Apply changes button) to save the data.

**SAML Service Provider Screenshot**

[![image-1652361192558.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652361192558.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652361192558.png)

**OpenID Connect Service Provider Screenshot**

[![image-1652361115515.png](https://bookstack.soffid.com/uploads/images/gallery/2022-05/scaled-1680-/image-1652361115515.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-05/image-1652361115515.png)

---

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8.</span> Enable, when it will be necessary, the External SAML identity provider. To do that you need to access to the Authentication page:

`Main Menu > Administration > Configure Soffid > Security settings > Authentication`

[![image-1643294485047.png](https://bookstack.soffid.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643294485047.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-01/image-1643294485047.png)

<p class="callout info">You can visit the [Authentication page](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/authentication "Authentication") for more information.</p>

# Change Password URL

There is a service point to allow users change their passwords. Simply redirect the user to:

```
https://<YOUR_SYNCSERVER_HOSTNAME>:1443/protected/passwordChange
```

For instance: [https://iam-sync-idp.soffidnet:1443/protected/passwordChange](https://iam-sync-idp.soffidnet:1443/protected/passwordChange)

<details id="bkmrk-%F0%9F%92%BB-image"><summary>💻 Image</summary>

[![image-1714486394997.png](https://bookstack.soffid.com/uploads/images/gallery/2024-04/scaled-1680-/image-1714486394997.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-04/image-1714486394997.png)

</details>
The user will be required to enter identify itself and enter a new password. Optionally, you can enter a web page to return after password change is complete:

[https://**servername:port**/protected/changePassword?return=**URL**](https://servernameport)

# How to perform unsolicited login

Soffid Identity Provider supports unsolicited login (Idp initiated login) profile. In order to enable it, you must be sure that federation metadata for the target service provider allows it. It is configured using the AuthnRequestsSigned attribute of the SPSSODescriptor tag:

```
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" ID=....." entityID="...Service Provider Public ID....">
  <md:SPSSODescriptor AuthnRequestsSigned="0" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
```

Once it is enabled, you can access to:

[<span class="nolink">https://**IdentityProvider:port**/profile/SAML2/Unsolicited/SSO?providerId=</span>&lt;**ServiceProviderPublicID**&gt;](https://IdentityProviderport)

Now, you will be requested to show your credentials. If they are valid, you will be redirected to the service provider initial page.

---

Another way to achieve the same functionality when the service provider is Shibboleth, is to send the request directly to the service provider. This approach has an additional advantage, as you can specify which URL must be served by the service provider.

[<span class="nolink">https://**ServiceProvider:port**/Shibboleth.sso/Login?target=**TargetURL**</span>](https://ServiceProviderport)

# How to enable Kerberos authentication

## Step-by-step

To enable the kerberos authentication method, the identity provider must have a keytab file that enables it to authenticate users. The steps to get it are described below:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>First of all, you need to create a net user. You can use the old-fashioned but still useful net user command:

`NET USER SoffidIdP <NewPassword> /ADD /DOMAIN`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>The second step will be to create a service name and generate a keytab file.

`KTPASS /out krb5.keytab /princ HTTP/<your.idp.host.name.in.lower.case>@<YOUR.AD-DOMAIN.IN.UPPER.CASE> /mapuser SoffidIdp /crypto ALL /ptype KRB5_NT_PRINCIPAL /pass <NewPassword> /target <YOUR.AD-DOMAIN.IN.UPPER.CASE>`

Mind that the browser expects the server name in the URL bar matches the principal name you have just created.

Warning: It is very important to put the **domain name in uppercase**.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-tqrcbdod.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3. </span> Finally, you need to add the keytab file to the identity provider configuration.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.1. </span>Open the Identity &amp; Service providers page

`Main Menu > Administration > Configure Soffid > Web SSO > Identity & Service providers`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.2. </span>Click on the Identity Provider you are configuring. Then Soffid will display the Identity Provider detail.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.3. </span>On the Authentication section, on the Kerberos domain list, you can click on the add button (+) to pick up the keytab file.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.4. </span>Pick up the keytab file and Soffid will load automatically into the console.

Mind that the active directory agent for this domain must be successfully connected, as it is needed to translate the kerberos identity to a user name.

# Connecting Service Providers



# Connecting an OpenID Connect service

## Introduction

There are three basic OpenID flows, depending whether the service name must be authenticated using its client secret or not:

### OpenID flow

> **Implicit flow**
> 
> - The Service Provider sends the user to the IdP.
> - The IdP authenticates the user.
> - The user returns control to the Service Provider along an OpenID token and an OAuth token.
> 
> **Client credentials flow**
> 
> - The Service Provider sends the user to the IdP.
> - The IdP authenticates the user.
> - The user returns control to the Service Provider along an authorization code.
> - The Service Provider gets the OpenID token and OAuth token from the IdP by presenting the authorization code, and its client secret. This request is using a direct connection between them.
> 
> **Password authentication flow**
> 
> - The Service Provider asks for a user name and password.
> - The Service Provider gets the OpenID token and OAuth token from the IdP by presenting the user's name and password, and optionally its client secret. This request is using a direct connection between them.


## Register an OpenId Connect Service Provider

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> To register an OpenId Connect service provider, open the federation page:

`Main Menu > Administration > Configuration > Web SSO > Identity & Service providers`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> Then, select an Entity Group and the branch Service Providers and click on the **Add Service Provider** button.

[![image-1689235669464.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689235669464.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689235669464.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Soffid will display the following window:

[![image-1689236053673.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689236053673.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689236053673.png)

<p class="callout info">For more information about the attributes, you can visit [the OpenID Connect detailed info](https://bookstack.soffid.com/link/392#bkmrk-openid-connect).</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> Finally, you must apply changes.

<div class="pointer-container" id="bkmrk-%C2%A0"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div>## Examples

### 1. Authorization code flow

The client application creates a random String, named nonce, and sends to the user the following URL

#### Request

<table border="0" id="bkmrk-https%3A%2F%2F%3Cidentitypro" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-color: #33bde0; border-style: solid;">http<span style="color: #000000;">s://[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)/<span style="color: #ff0000;">**authorization**</span>?</span>

<span style="color: #000000;">**redirect\_uri**=https://&lt;serviceprovider&gt;/response&amp;</span>

<span style="color: #000000;">**client\_id**=MYCLIENT&amp;</span>

<span style="color: #000000;">**nonce**=1234567980123456</span>7890&amp;

**scope**=openid+test+other&amp;

**response\_type**=code

</td></tr></tbody></table>

Then, the user will be asked for a username and password, or any other means of authentication. After authenticating the user, the browser will be redirected to the URL configured in the service provider page, adding a one-time authorization code.

<div data-lang="western align-left" id="bkmrk-https%3A%2F%2Fiam-sync-ten"><textarea style="display: none;">https://iam-sync-tenantidp.soffidnet:2443/authorization?redirect\_uri=http://localhost/return&amp;client\_id=tenant&amp;nonce=123456789&amp;scope=openid+test&amp;response\_type=code</textarea></div><table border="0" id="bkmrk-https%3A%2F%2F%3Cserviceprov" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">https://&lt;serviceprovider&gt;/response/?  
code=XXXXXXXXXXXXXXX&amp;  
nonce=12345679801234567980

</td></tr></tbody></table>

Once the service provider has received the one-time authorization code, it can connect to the identity provider to retrieve the oAuth token, as well as the OpenID token.

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;"><span style="color: #000000;">**POST** [https://youridentityprovider:2443/<span style="color: #ff0000;">**token**</span>](https://soffid.bubu.lab:2443/token)</span>

*<span style="color: #000000;">HEADERS</span>*

<span style="color: #000000;">**Accept**: application/json</span>

<span style="color: #000000;">**Authorization**: Basic dGVzdDp0ZXN0</span>

**Content-Type:** application/x-www-form-urlencoded

*BODY PARAMS*

**grant\_type**=authorization\_code&amp;

**code**=XXXXXXXXXXXX

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains, coded in base 64, the **client id** and the **client secret**, as it would have been sent for a standard Basic authentication header. The identity provider will match these against the stored credentials.
- **grant\_type**: should be authorization\_code.
- **code**: should be the one-time authorization code received in the previous requested.

#### Response

<table border="0" id="bkmrk-%7B-%C2%A0-%C2%A0-%22access_token%22" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{

 "access\_token":"8bDP2P...",

 "refresh\_token":"gjLmSW...",

 "id\_token":"eyJra.eyJ.LQ\_XtHKr.RY3A4...",

 "token\_type":"Bearer",

 "expires\_in":11998

}

</td></tr></tbody></table>

- The *id\_token* tag contains the OpenId token.
- The *access\_token* tag contains the oAuth token.

Before the number of seconds specified om *expires\_in* are elapsed, the token can be renewed by invoking again the token endpoint changing the grant\_type:

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s-0" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">**POS**<span style="color: #000000;">**T** [https://](https://soffid.bubu.lab:2443/token)[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)[/<span style="color: #ff0000;">**token**</span>](https://soffid.bubu.lab:2443/token)</span>

<span style="color: #000000;">*HEADERS*</span>

<span style="color: #000000;">**Accept**: application/json</span>  
<span style="color: #000000;">**Authorization**: Basic dGVzdDp0ZXN0</span>  
<span style="color: #000000;">**Content-Type**: application/x-www-form-urlencoded</span>

*BODY PARAMS*

**grant\_type**=refresh\_token&amp;

**refresh\_token**=gjLmSW...

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains, coded in base 64, the **client id** and the **client secret**, as it would have been sent for a standard Basic authentication header. The identity provider will match these against the stored credentials.
- **grant\_type**: should be refresh\_token.
- **refresh\_code**: should be refresh code received in the previous requested.

#### Response

<table border="0" id="bkmrk-%7B-%C2%A0-%C2%A0-%22access_token%22-0" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{

 "access\_token":"8bDP2P...",

 "refresh\_token":"gjLmSW...",

 "id\_token":"eyJra.eyJ.LQ\_XtHKr.RY3A4...",

 "token\_type":"Bearer",

 "expires\_in":11998

}

</td></tr></tbody></table>

### 2. User’s password + client credentials flow

The application asks the user for the user name and password. Then, it connects to the token endpoint to get an access token:

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s-1" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;"><span style="color: #000000;">**POST** [https://](https://soffid.bubu.lab:2443/token)[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)[/<span style="color: #ff0000;">**token**</span>](https://soffid.bubu.lab:2443/token)</span>

*<span style="color: #000000;">HEADERS</span>*

<span style="color: #000000;">**Accept**: application/json</span>  
<span style="color: #000000;">**Authorization**: Basic dGVzdDp0ZXN0</span>  
<span style="color: #000000;">**Content-Type**: application/x-www-form-urlencoded</span>

*BODY PARAMS*

<span style="color: #000000;">**grant\_type**=password&amp;</span>  
**username**=USER&amp;  
**password**=PASSWORD&amp;XXXXXXXXXXXX

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains, coded in base 64, the client id and the client secret, as it would have been sent for a standard Basic authentication header. The identity provider will match these against the stored credentials
- **grant\_type**: should be password
- **username**: must be the user name entered by the user.
- **password**: must be the password entered by the user.

#### Response

<table border="0" id="bkmrk-%7B-%C2%A0-%C2%A0-%22access_token%22-3" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{  
 "access\_token":"8bDP2P...",  
 "refresh\_token":"gjLmSW...",  
 "id\_token":"eyJra.eyJ.LQ\_XtHKr.RY3A4...",  
 "token\_type":"Bearer",  
 "expires\_in":11998   
}

</td></tr></tbody></table>

- The *id\_token* tag contains the openid token.
- The *access\_token* tag contains the oAuth token.

Before the number of seconds specified in expires\_in are elapsed, the token can be renewed by invoking again the token endpoint:

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s-2" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7; height: 146px;"><tbody><tr style="height: 146px;"><td style="width: 100%; border-style: solid; border-color: #33bde0; height: 146px;"><span style="color: #000000;">**POST** [https://](https://soffid.bubu.lab:2443/token)[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)[/<span style="color: #ff0000;">**token**</span>](https://soffid.bubu.lab:2443/token)</span>

*<span style="color: #000000;">HEADERS</span>*

<span style="color: #000000;">**Accept**: application/json</span>  
<span style="color: #000000;">**Authorization**: Basic dGVzdDp0ZXN0</span>  
**Content-Type:** application/x-www-form-urlencoded

*BODY PARAMS*

**grant\_type**=refresh\_token&amp;

**refresh\_token**=gjLmSW...

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains, coded in base 64, the client id and the client secret, as it would have been sent for a standard Basic authentication header. The identity provider will match these against the stored credentials
- **grant\_type**: should be refresh\_token
- **refresh\_code**: should be refresh code received in the previous requested

#### Response

<table border="0" id="bkmrk-%7B%C2%A0-%C2%A0-%22access_token%22%3A" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7; height: 146px;"><tbody><tr style="height: 146px;"><td style="width: 100%; border-style: solid; border-color: #33bde0; height: 146px;">{  
 "access\_token":"8bDP2P...",  
 "refresh\_token":"gjLmSW...",  
 "id\_token":"eyJra.eyJ.LQ\_XtHKr.RY3A4...",  
 "token\_type":"Bearer",  
 "expires\_in":11998   
}

</td></tr></tbody></table>

### 3. Closing the session

The application wants to revoke the token and session cookie:

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s-3" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">**POST** h<span style="color: #000000;">ttps://[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)</span>/<span style="color: #ff0000;">**revoke**</span>

*HEADERS*

**Accept**: application/json  
**Content-type**: application/x-www-form-urlencoded  
**Authorization**: Basic dGVzdDp0ZXN0

*BODY PARAMS*

**token\_type\_hint**=token=access\_token&amp;

**token**=8bDP2P...

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains the encoded client id and client secret.
- **token\_type\_hint**: can have the following values: 
    - access\_token
    - refresh\_token
    - session\_cookie
- **token**: contains the authorization token, refresh\_token or session\_cookie value

### 4. Getting user attributes

All the user attributes can be extracted from the OpenID token. Anyway, it is possible to get them in a more readable format user the user-info endpoint.

#### Request

<table border="0" id="bkmrk-get-https%3A%2F%2F%3Cyour_se" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7; height: 79px;"><tbody><tr style="height: 79px;"><td style="width: 100%; border-style: solid; border-color: #33bde0; height: 79px;"><span style="color: #000000;">**GET** [https://](https://soffid.bubu.lab:2443/session_cookie)[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)[/<span style="color: #ff0000;">**userinfo**</span>](https://soffid.bubu.lab:2443/session_cookie)</span>

*<span style="color: #000000;">HEADERS</span>*

<span style="color: #000000;">**Accept**: application/json</span>  
<span style="color: #000000;">**Authorization**: Bearer dGVzdDp0ZXN0</span>

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains a valid access token.

#### Response

<table border="0" id="bkmrk-%7B-%C2%A0-%C2%A0-%22sub%22%3A-%22admin%22" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{

 "sub": "admin",

 "surname": "Admin",

 "given\_name": "Admin",

 "member\_of": \[

 "TestRole2@soffid",

 "TestRole@soffid"

 \]

}

</td></tr></tbody></table>

### 5. Getting a session cookie for the user

Sometimes, a mobile application has authenticated the user using the username &amp; password grant, but wants to share this authenticated session with the underlying web browser. For such a case, the application can request a session cookie with this request:

#### Request

<table border="0" id="bkmrk-get-https%3A%2F%2F%3Cyour_se-0" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">**GET** <span style="color: #000000;">[https://](https://soffid.bubu.lab:2443/session_cookie)[youridentityprovider:2443](https://soffid.bubu.lab:2443/token)[/session\_cookie](https://soffid.bubu.lab:2443/session_cookie)</span>

*<span style="color: #000000;">HEADERS</span>*

<span style="color: #000000;">**Accept**: ap</span>plication/json  
**Authorization**: Bearer dGVzdDp0ZXN0

</td></tr></tbody></table>

##### Parameters

- **Authorization**: contains a valid access token.

#### Response

<table border="0" id="bkmrk-%7B-%C2%A0-%C2%A0-%22stats%22%3A%22succe" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{

"cookie\_domain": "cookied",  
"user": "pgarcia",  
"cookie\_value": "5458083\_bT2CZlaa6psl/q3ue6NObxX8Q7duQKj0hAuUJIouT5Y=",  
"cookie\_name": "cookien"

}

</td></tr></tbody></table>

<p class="callout warning">Please note that it is mandatory to fill in the name of the cookie in the identity provider, at the session management section</p>

# Connecting a SAML service

## Introduction

To connect a SAML service provider, the service provider must offer you its SAML metadata. The SAML metadata contains inform<span style="color: #000000;">ation about its public id, the</span> services that implement and the service endpoints.

## Register a SAML service provider

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Open the **Identity &amp; Service Provider** page.

`<span class="link" id="bkmrk-main-menu">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0"> > </span><span class="link" id="bkmrk-administration">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-0"> > </span><span class="link" id="bkmrk-configure-soffid">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-1"> > </span><span class="link" id="bkmrk-web-sso">Web SSO</span><span id="bkmrk-%C2%A0%3E%C2%A0-2"> > </span><span id="bkmrk-identity-%26-service-p">Identity & Service providers</span>`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> To add a new service provider, click on the **Add Service Provider** button.

<p class="callout info">Be in mind that you can configure more than one Entity Group and you could add new service providers in each one.</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Then you must fill in the required fields. Also, you need to provide the identity provider metadata. You can either copy it from the Soffid federation page or instruct the service provider to download the federation metadata by itself.

[![image-1689237747516.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689237747516.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689237747516.png)

<p class="callout info">For more information about the attributes, you can visit [the SAML detailed info](https://bookstack.soffid.com/link/392#bkmrk-openid-connecthttps://bookstack.soffid.com/link/392#bkmrk-saml).</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4. </span>To publish the federation members metadata, the main sync server exports the members metadata at the path /SAML/metadata.xml. Thus, if your sync server is listening at soffid1.your.domain, you can get the whole federation metadata document from https://soffid1.your.domain:760/SAML/metadata.xml.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5. </span>After some seconds, up to five minutes, every federation member will notice any change.

# Connecting Soffid console

## Introduction

Soffid console has a built-in SAML client, so it can act as a service provider in the Soffid federation. It is interesting to use this configuration, as it allows you to enforce the use of two factors authentication to log into the Soffid console.

### Register Soffid as a service provider

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Enable the SAML protocol in the Soffid console:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.1.</span> Open the **Authentication** page:

`Main Menu > Administration > Configure Soffid > Security settings > Authentication`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.2.</span> You must enable the **External XAML identity provider**.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.3.</span> Then you must fill in the fields:

[![image-1689256229585.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689256229585.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689256229585.png)

- **Soffid server host name**: URL of the Soffid console.
- **SAML federation metadata URL**: URL where the whole federation metadata can be obtained. It used to be [https://your.primary.sync.server:760/SAML/metadata.xml ](https://your.primary.sync.server:760/SAM/metadata.xml)Sometimes, an error as "unable to find valid certification path to requested target" could be displayed.

In that case, you must obtain the public certificate from the sync server and store in your Java trusted certs repository. To do that, use the keytool command. The trusted certs repository is located at &lt;JAVA\_HOME&gt;/lib/security/cacerts

The command should look like the next one. When prompted for a password type in "changeit"

<table border="0" id="bkmrk-post-https%3A%2F%2Ftargeta" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">root@myserver:~$ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool   
-import -file /tmp/RootCA -trustcacerts -alias syncserver  
-keystore /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts

</td></tr></tbody></table>

- **Cache limit (seconds)**: the amount of time the metadata should be kept in memory before refreshing.
- **Identity provider**: after reading the federation metadata, this drop-down box lets you select any identity provider present at the federation. Usually, you will select the Soffid IdP.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span><span style="background-color: #ffffff;"> Download Soffid console metadata: </span>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.1.</span> Open the **Authentication** page:

`Main Menu > Administration > Configure Soffid > Security settings > Authentication`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.1. </span><span style="background-color: #ffffff;">Click the **Download metadata** button and save the file.</span>

[![image-1689329490746.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689329490746.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689329490746.png)

This XML file is the metadata descriptor for the console, including a self-signed certificate generated to sign SAML requests.

The XML file will be like the next one:

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-qh53z6p1.png)

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Register Soffid Metadata in the third-party Identity Provider.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> You can use the Wizard to Add Applications

[![image-1689334608813.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689334608813.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689334608813.png)

<p class="callout info">For more information, visit [the Add Applications page.](https://bookstack.soffid.com/books/configuration-wizard/page/add-applications-qO4)</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> Test it

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.1.</span> Next time you log into the Soffid console, a new button will appear for **External (XAML) login**

[![image-1640009166065.png](https://bookstack.soffid.com/uploads/images/gallery/2021-12/scaled-1680-/image-1640009166065.png)](https://bookstack.soffid.com/uploads/images/gallery/2021-12/image-1640009166065.png)

**<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.2.</span>** Click on the External (SAML) login button, and the user will be forwarded to the identity provider.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-09/embedded-image-zhqz8evp.png)

# Connecting your custom applications

## Introduction

SAML 2.0 is a complex and not easy to implement standard. There are some libraries that can help somewhat, but a correct implementation needs a deep knowledge of SAML protocol, and is always hard to test and debug.

To make it easier, Soffid provides some JSON rest web services, that can help any application to correctly implement the SAML service provider part of the protocol.

## Data flow

The following diagram, shows the resulting data flow between the end user, your application, the identity provider and Soffid web services:

<div drawio-diagram="478"><img src="https://bookstack.soffid.com/uploads/images/drawio/2021-10/drawing-5-1633684556.png" alt=""/></div>

### Data flow steps

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> The end-user requests access to a protected page

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> The custom application can check the user identity looking up a session variable. By the time being, the user is not authenticated.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> The custom application issues a JSON request to Soffid web service. In turn, Soffid web service builds, signs and maybe encrypts a SAML request

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> Then custom application taks the JSON request and builds an HTTP Redirect response with the received data.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> The identity provider identifies the user as usual.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> The custom application receives the SAML response. At this point, the application packs and forwards the received data to Soffid Web Service.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.</span> Soffid Web Service decrypts and checks SAML response integrity and correctnes, and returns a JSON document specifying the success or failure status, and the underlying identity attributes. If needed, Soffid web service can provision a new identity in target systems on the fly.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8.</span> The custom application gets the identity data, stores it in a session variable and provides the protected resource to the end user.

In order to get it, will be necessary:

1. Declare the custom application as an internal service provider in the federation page.
2. Create a Soffid application account for the custom application.
3. Implement the protection filters.
4. Implement the endpoint where the SAML response must be sent.

## Example

### 1. Creating an internal service provider

You can create an internal service provider as a SAML service provider.

### 2. SAML Request generator

After deploying Soffid SAML addon, a web service to generate SAML request will be automatically deployed. This web service requires an account with the **federation:serviceProvider** authorization.

The endpoint will be locate in Soffid Console:

[http://your.soffid.console:8080/webservice/federation/rest/generate-saml-request](http://your.soffid.console:8080/webservice/federation/rest/generate-saml-request)

Method:

```POST`

Headers to include in the request:

`Accept = “application/json”`  
`Content-Type = “application/json”`

Request: Send a JSON decument with following fields:

`user → suggested user to authenticate (optional)`  
`identityProvider → identity provider public ID. Must match the public ID of any`  
`identity provider registered in Soffid federation.`  
`serviceProviderName → service provider which requests the user`  
`authentication. Must match the public ID of an internal service provider`  
`sessionSeconds → max time for the user session inactivity`

Response:

`method → Method to use: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`  
`instructs the application to build a HTML Form that automatically submits the`  
`following parameters. Value urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`  
`instructs the application to perform a redirect (Location HTTP header) with the`  
`URL and parameters specified`  
`parameters → every parameter included must be submited to the identity`  
`provider. Usually, these two will be present:`  
`RelayState → identifier of the ticket of the SAML request`  
`SAMLRequest → encoded SAML request`  
`url → identity provider endpoint.`

Request sample:

<table border="0" id="bkmrk-%5B%C2%A0-%C2%A0-%C2%A0%7B%C2%A0-%C2%A0-%C2%A0-%C2%A0-%C2%A0%22pat" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{

 "user" : "myuser@soffid.poc",  
 "identityProvider" : "my-service-provider",  
 "serviceProviderName" : "https://idp.soffid.com",  
 "sessionSeconds" : "3600"

}

</td></tr></tbody></table>

Response sample:

<table border="0" id="bkmrk-%7B%C2%A0-%C2%A0-%22method%22%3A-%22urn%3A" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{  
 "method": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect",  
 "parameters": {  
 "RelayState":  
 "\_457cab260c4948ef4c6d35a67cac000d3348d1ec48f53215",  
 SAMLRequest":  
 “PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ..."  
 },  
 "url": "https://idp.soffid.com/SAML/Redirect"  
}

</td></tr></tbody></table>

### 3.

In turn, your application will issue the following location header to the browser

<table border="0" id="bkmrk-location%3A-https%3A%2F%2Fid" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">Location: https://idp.soffid.com/SAML/Redirect?RelayState=\_457cab260c4948ef4c6d35a67cac000d3348d1ec48f53215&amp;SAMLRequest=PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ...

</td></tr></tbody></table>

Should the method be urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST, your application should build an HTML similar the following one:

<table border="0" id="bkmrk-%3Cform-action%3D%22https%3A" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">&lt;form action="https://idp.soffid.com/SAML/Redirect"&gt;  
 &lt;input type="hidden" name="RelayState" value="457cab260c4948ef4c6d35a67cac000d3348d1ec48f53215" /&gt;  
 &lt;input type="hidden" name="SAMLRequest" value="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ....."  
/&gt;  
&lt;/form&gt;  
&lt;script&gt;  
 document.form\[0\].submit();  
&lt;/script&gt;

</td></tr></tbody></table>

### 4. SAML Response endpoints

Your application must implement the SAML response endpoint. This endpoint must accept the POST method and forward each received parameter to Soffid's parse-saml-response. Mind that your endpoint must accept application/x-www-form-urlencoded parametern while Soffid service accepts application/json.

Soffid endpoint will be located in Soffid Console:

`http://your.soffid.console:8080/webservice/federation/rest/generate-saml-request`

Method:

`POST`

Headers:

`Accept = “application/json”`  
`Content-Type = “application/json”`

Authentication:

Use your application account to login using basic authentication schema. In multitenant environments, the user name will have the forma TENANT\_NAME\\ACCOUNT\_NAME

Request: send a JSON document with following fields

`autoProvision → [false|true] Set to true if you want Soffid to automatically enroll`  
`unknown identities. This is not normally needed if you are using Soffid IdP, but it's`  
`useful when using third party IdPs.`  
`response: JSON object with any parameter received in post method.`  
`RelayState → identifier of the ticket of the SAML response`  
`SAMLResponse → encoded SAML response`  
`protocol → use always “urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST”`  
`serviceProviderName → service provider which requests the user authentication`

Response:

`authentication → [yes|no]`  
`failureMessage → if authentication=”no”, a message with the error cause.`  
`principalName → account name, as sent by the IdP`  
`user → Soffid identity with standard attributes`  
`attributes → Soffid identity custom attributes`  
`sessionId → session identifier`

##### Example data received by your endpoint

<table border="0" id="bkmrk-post-%2Fsaml-receiverh" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">POST /saml-receiver  
Host: my-service-provider  
Content-Type: application/x-www-form-urlencoded  
RelayState=\_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2&amp;SAMLResponse=PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ.…

</td></tr></tbody></table>

##### Example request

<table border="0" id="bkmrk-%7B%C2%A0-%C2%A0-%22autoprovision%22" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{  
 "autoProvision" : false,  
 "response" : {  
 "RelayState":  
 "\_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2",  
 "SAMLResponse":  
 "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ...."  
 },  
 "protocol" : "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",  
 "serviceProviderName" : "my-service-provider"  
}

</td></tr></tbody></table>

##### Example response

<table border="0" id="bkmrk-%7B%C2%A0-%C2%A0-%22authentication" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">{  
 "authentication": "yes",  
 "principalName": "your-name@somedomain.com",  
 "user": {  
 "id": 123456,  
 "userName": "your-id",  
 "firstName": "Your",  
 "lastName": "Name",  
 "primaryGroup": "enterprise",  
 "active": true,  
 "shortName": "your-name",  
 "mailDomain": "somedomain.com"  
 },  
 "attributes": {  
 "employeeId": "AS14567"  
 },  
 "sessionId": "ABCTASHO54684A"  
}

</td></tr></tbody></table>

# Openid-connect to SAML interoperability

## Introduction

**OpenID-Connect** has a clear design suitable for both frontend and backend.

**SAML** has a clear design for the frontend, but the backend usage is harder as the security in SAML cannot be placed at transport layer. Instead, in must be placed at document level. Additionally, it requires intensive use of cryptographic algorithms for signature and encryption.

That’s why some applications put a SAML frontend protection for both the frontend and relay on the session cookies generated by the fronted for backend access.

The problem arises when one service provider needs to invoke some services from a SAML enabled application that does not support or implement WS-Security.

To solve it, **Soffid Identity Provide**r provides a service to get the session cookies required to access to a SAML application.

## Data flow

The rest service **/userinfo/impersonate?url=….** will do the job, and will return the cookies to use to act upon the target application impersonating the current user.

<div drawio-diagram="487"><img src="https://bookstack.soffid.com/uploads/images/drawio/2021-10/drawing-5-1634292052.png" alt=""/></div>

#### Request

<table border="0" id="bkmrk-post-https%3A%2F%2F%3Cyour_s" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">POST [https://&lt;YOUR\_SERVER&gt;:2443/](https://soffid.bubu.lab:2443/token)userinfo/impersonate?url=http://targetapplication/  
Accept: application/json  
Content-type: application/x-www-form-urlencoded  
Authorization: Basic dGVzdDp0ZXN0

\[  
 {  
 "path":"/",  
 "domain":"samltest.id",  
 "name":"\_shibsession\_64656661756c7468747470733a2f2f73616d6c746573742e69642f73616d6c2f7370",  
 "value":"\_fa49874951dd05c18a0f68642c0736e9"  
 },  
 {  
 "path":"/",  
 "domain":"samltest.id",  
 "name":"\_opensaml\_req\_ss%3Amem%3A88b0af3e1ff47c911257490bc1a5749dfda1670948a563cec2fdf9e8a799f2c4",  
 "value":""

 }  
\]

</td></tr></tbody></table>

##### Parameters

- **URL**: is the access URL for the target application.
- **Authorization**: contains the oauth token.

#### Response

The response contains the list of cookies to send to the target application.

<table border="0" id="bkmrk-%5B%C2%A0-%C2%A0-%C2%A0%7B%C2%A0-%C2%A0-%C2%A0-%C2%A0-%C2%A0%22pat" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">\[  
 {  
 "path":"/",  
 "domain":"samltest.id",  
 "name":"\_shibsession\_64656661756c7468747470733a2f2f73616d6c746573742e69642f73616d6c2f7370",  
 "value":"\_fa49874951dd05c18a0f68642c0736e9"  
 },  
 {  
 "path":"/",  
 "domain":"samltest.id",  
 "name":"\_opensaml\_req\_ss%3Amem%3A88b0af3e1ff47c911257490bc1a5749dfda1670948a563cec2fdf9e8a799f2c4",  
 "value":""

 }  
\]

</td></tr></tbody></table>

#### Request

Once the application has got the list of cookies, it can invoke the target application URL

<table border="0" id="bkmrk-post-https%3A%2F%2Ftargeta" style="width: 98.3951%; border-collapse: collapse; border-style: solid; border-color: #6983a7;"><tbody><tr><td style="width: 100%; border-style: solid; border-color: #33bde0;">POST [https://targetapplication/api/service1](https://targetapplication/api/service1)  
Accept: application/json  
Content-type: application/json  
Cookie: cookie1=value1

</td></tr></tbody></table>

<p class="callout info">As security measures, the impersonation profile must be enabled, and the source application must be entitled to use it against the target application</p>

# Openid-connect Dynamic Register

## Introduction

Openid-connect allows a service provider registers dynamically other service providers.

## Dynamic Register

To dynamically register a client, acquire an initial access token, and then register the new application by using the registration API. You can get the access token from Soffid.

#### Register Server

##### Request

```shell
POST https://<YOUR_SERVER>:2443/register
```

**Authorization**

- **Authorization**: contains the Bearer Token.

**Header**

- **Content-type**: application/x-www-form-urlencoded

**JSON**

```shell
{
    "application_type": "web",
    "redirect_uris":
        ["https://client.example.org/callback",
         "https://client.example.org/callback2"],
    "client_name": "My Example 7",
    "logo_uri": "https://client.example.org/logo.png",
    "subject_type": "pairwise",
    "token_endpoint_auth_method": "client_secret_basic",
    "jwks_uri": "https://client.example.org/my_public_keys.jwks",
    "userinfo_encrypted_response_alg": "RSA1_5",
    "userinfo_encrypted_response_enc": "A128CBC-HS256",
    "contacts": ["ve7jtb@example.org", "mary@example.org"],
    "request_uris":
        ["https://client.example.org/rf.txt#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"]
}
```

##### Response 200 OK

```shell
{
    "client_secret_expires_at": 0,
    "registration_client_uri": "https://iam-sync-tenantidp.soffidnet:2443/register?client_id=DR_7",
    "client_secret": "wBeH8G6hT2GRwr7jJ6HfX2lMJDGdwGi9M49SKF2MjHRGOtwZ",
    "redirect_uris": [
        "https://client.example.org/callback",
        "https://client.example.org/callback2"
    ],
    "registration_access_token": "NjYxODg1Ng.AFa8jQbltq+bocWQpT3okPvHXHrTM+HqXQC26Kz5mfAWfXWG",
    "client_name": "My Example 7",
    "client_id": "DR_7"
}
```

#### Client read request

##### Request

```shell
GET https://<YOUR_SERVER>:2443/register?client_id=DR_7
```

**Authorization**

- **Authorization**: contains the Bearer Token. It contains the registration\_access\_token Token received as the response when the server was registered.

**Header**

- **Content-type**: application/json

**Params**

- **client\_id**

##### Response

```shell
{
    "client_secret_expires_at": 0,
    "registration_client_uri": "https://iam-sync-tenantidp.soffidnet:2443/register?client_id=DR_7",
    "redirect_uris": [
        "https://client.example.org/callback",
        "https://client.example.org/callback2"
    ],
    "client_name": "My Example 7",
    "client_id": "DR_7"
}
```

####   

# Connecting CAS client

## Introduction

The CAS protocol is a simple and powerful ticket-based protocol. It involves one or many clients and one server. Clients are embedded in CASified applications (called “CAS services”) whereas the CAS server is a standalone component.

## Register CAS client

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Open the **Identity &amp; Service Provider** page.

`<span class="link" id="bkmrk-main-menu">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0"> > </span><span class="link" id="bkmrk-administration">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-0"> > </span><span class="link" id="bkmrk-configure-soffid">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-1"> > </span><span class="link" id="bkmrk-web-sso">Web SSO</span><span id="bkmrk-%C2%A0%3E%C2%A0-2"> > </span><span id="bkmrk-identity-%26-service-p">Identity & Service providers</span>`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> To add a new service provider, click on the **Add Service Provider** button.

<p class="callout info">Be in mind that you can configure more than one Entity Group and you could add new service providers in each one.</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Then you must fill in the required fields. Also, you need to provide the identity provider metadata. You can either copy it from the Soffid federation page or instruct the service provider to download the federation metadata by itself.

## [![image-1661408241083.png](https://bookstack.soffid.com/uploads/images/gallery/2022-08/scaled-1680-/image-1661408241083.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-08/image-1661408241083.png)

<p class="callout info">For more information about the attributes, you can visit [the CAS client detailed info](https://bookstack.soffid.com/link/392#bkmrk-cas-client).</p>

# Connecting Tacacs+

## Introduction

TACACS (**Terminal Access Controller Access Control System**) is a security protocol that provides centralized validation of users who are attempting to gain access to a router or NAS

TACACS+ is a protocol for AAA services:

- Authentication
- Authorization
- Accounting

## Register Tacas+

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Open the **Identity &amp; Service Provider** page.

`<span class="link" id="bkmrk-main-menu">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0"> > </span><span class="link" id="bkmrk-administration">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-0"> > </span><span class="link" id="bkmrk-configure-soffid">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-1"> > </span><span class="link" id="bkmrk-web-sso">Web SSO</span><span id="bkmrk-%C2%A0%3E%C2%A0-2"> > </span><span id="bkmrk-identity-%26-service-p">Identity & Service providers</span>`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> To add a new service provider, click on the **Add Service Provider** button.

<p class="callout info">Be in mind that you can configure more than one Entity Group and you could add new service providers in each one.</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Then you must fill in the required fields. Also, you need to provide the identity provider metadata. You can either copy it from the Soffid federation page or instruct the service provider to download the federation metadata by itself.

[![image-1681221680349.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221680349.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221680349.png)

<p class="callout info">For more information about the attributes, you can visit [the Tacacs+ detailed info](https://bookstack.soffid.com/link/392#bkmrk-tacacs%2B).</p>

When a Tacacs Service Provider is created, Soffid creates an Information System

[![image-1681221732876.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221732876.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221732876.png)

There are some roles defined for this Information System (0: anonymous, 1: user, ....15: root)

[![image-1681221803826.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681221803826.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681221803826.png)

# Connecting Radius client

## Introduction

The Radius protocol (Remote Authentication Dial-In User Service) is a networking protocol that authorizes and authenticates users who access a remote network.

## Register a Radius client

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Open the **Identity &amp; Service Provider** page.

`<span class="link" id="bkmrk-main-menu">Main Menu</span><span id="bkmrk-%C2%A0%3E%C2%A0"> > </span><span class="link" id="bkmrk-administration">Administration</span><span id="bkmrk-%C2%A0%3E%C2%A0-0"> > </span><span class="link" id="bkmrk-configure-soffid">Configure Soffid</span><span id="bkmrk-%C2%A0%3E%C2%A0-1"> > </span><span class="link" id="bkmrk-web-sso">Web SSO</span><span id="bkmrk-%C2%A0%3E%C2%A0-2"> > </span><span id="bkmrk-identity-%26-service-p">Identity & Service providers</span>`

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> To add a new service provider, click the **Add Service Provider** button.

<p class="callout info">Be in mind that you can configure more than one Entity Group and you could add new service providers in each one.</p>

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Then, you must fill in the required fields. Also, you need to provide the identity provider metadata. You can either copy it from the Soffid federation page or instruct the service provider to download the federation metadata by itself.

[![image-1689336949656.png](https://bookstack.soffid.com/uploads/images/gallery/2023-07/scaled-1680-/image-1689336949656.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-07/image-1689336949656.png)

<p class="callout info">For more information about the attributes, you can visit [the Radius detailed info.](https://bookstack.soffid.com/link/392#bkmrk-radius-client)</p>

# Web services reference



# validate-domain

##### Definition

- This operation allows to validate the user domain and return the IDP ower of the user.

##### URL

- &lt;console-domain&gt;/webservice/federation/rest/validate-domain

##### Method

- POST

##### Headers

- Accept = “application/json”
- Content-Type = “application/json”

##### Authentication

- Use the “admin” user of the Soffid IAM Console

##### Request (body JSON)

- domain → domain of the user (right side of the email)

```
{
    "domain" : "arxus.eu"
}
```

##### Response (JSON)

- exists → \[yes|no\]
- identityProvider → identity provider public ID

```
{
    "exists": "yes",
    "identityProvider": "http://stasts-sof.arxus.eu/adfs/services/trust"
}
```

# validate-credentials

##### Definition

- This operation allows to validate the credentials of the user against Soffid.

##### URL

- &lt;console-domain&gt;/webservice/federation/rest/validate-credentials

##### Method

- POST

##### Headers

- Accept = “application/json”
- Content-Type = “application/json”

##### Authentication

- Use an account with **[federation:serviceProvider](http://federationserviceprovider/)** permission

##### Request (body JSON)

- user → user (or nick or alias)
- password → password of the user
- identityProvider → identity provider public ID
- serviceProviderName → service provider which requests the user authentication
- sessionSeconds → max time for the user session inactivity

```western
{
    "user" : "edmond.halley",
    "password" : "12345",
    "identityProvider" : "my-service-provider",
    "serviceProviderName" : "https://idp.soffid.com",
    "sessionSeconds" : "3600"
}
```

##### Response (JSON)

- authentication → \[yes|no\]
- principalName → account name
- failureMessage → if authentication=”no”, a description text of the error
- user → account owner identity standard attributes
- attributes → account owner identity custom attributes
- sessionId → session identifier

```western
{
    "valid": true,
    "sessionCookie": "_2307e8b5566ba600be64508a132f7f40c4578928733f2c3c:hRoFimsCGZSau7zjbWeVocTv13WAaui7dj00A7F39dM0R+daKHPQVi2WiAbhB/rV776S0TW5JXq7/9HjV0zo0h4E7AW72tCUD9I/8UD4VP5oTRWgR6xTP3mUwhn5NCuiHOE02kuITf6l3y6ZrUOBA6qVFo/Twlfhww9dZ2l7NrdrO/s3K40L",
    "attributes": {},
    "user": {
        "lastName": "Halley",
        "createdByUser": "csvIDs",
        "modifiedDate": "2017-12-15T11:01:02+01:00",
        "userType": "I",
        "shortName": "edmond.halley"
        },
    "identityProvider": "soffid"
}
```

# expire-session

##### Definition

- This operation allows to close a session created by either validate-credentials or parse-saml-response. If you want to get real global logout, this method invocation is not enough. You should also use the generate-saml-logout-request method.

##### URL

- &lt;console-domain&gt;/webservice/federation/rest/expire-session

##### Method

- POST

##### Headers

- Accept = “application/json”
- Content-Type = “application/json”

##### *Authentication*

- Use an account with **[federation:serviceProvider](http://federationserviceprovider/)** permission

##### Request (body JSON)

- sessionId → session id obtained from prior parse-saml-response or validate-credentials invocation

##### Response (JSON)

- sessionId → id of closed session

```
{
    "sessionId" : "_8164940b408c1508dfd84525a3ef568475f317085cf36e7d:rvJgZnMfsWUbQWlXdhTcVGgI3mC2qXJC..."
}
```

# generate-saml-request

<span style="font-size: 1.4em; font-weight: 400;">Definition</span>

- This operation allows to generate a SAML request to an external IDP.

##### URL

- &lt;console-domain&gt;/webservice/federation/rest/generate-saml-request

##### Method

- POST

##### Headers

- Accept = “application/json”
- Content-Type = “application/json”

##### Authentication

- Use an account with **[federation:serviceProvider](http://federationserviceprovider/)** permission

##### Request (body JSON)

- user → user (or nick or alias)
- identityProvider → identity provider public ID
- serviceProviderName → service provider which requests the user authentication
- sessionSeconds → max time for the user session inactivity

```western
{
    "user" : "lucasfr@soffid.poc",
    "identityProvider" : "http://stasts-sof.arxus.eu/adfs/services/trust",
    "serviceProviderName" : "http://portal.arxus.com",
    "sessionSeconds" : "3600"
}
```

##### Response (JSON)

- method → \[POST|GET\]
- parameters
    
    
    - RelayState → identifier of the ticket of the SAML request
    - SAMLRequest → encoded SAML request
- url → form’s target URL

```
{
    "method": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
    "parameters": {
        "RelayState": "_457cab260c4948ef4c6d35a67cac000d3348d1ec48f53215",
        "SAMLRequest": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ
        wOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1sMnA9InVybjpvYXNpczpuYW1lczp
     	YzpTQU1MOjIuMDpwcm90b2NvbCIgQXNzZXJ0aW9uQ29uc3VtZXJTZXJ2aWN
        lVVJMPSJodHRwczovL3BvcnRhbC5hcnh1cy5jb206NDQzL1NBTUwtcmVzcG9uc2UiIEZvcmNlQXV0aG49ImZhbHNlI
        iBJRD0iXzQ1N2NhYjI2MGM0OTQ4ZWY0YzZkMzVhNjdjYWMwMDBkMzM0OGQxZ
        WM0OGY1MzIxNSIgSXNzdWVJbnN0YW50PSIyMDE4LTAxLTExVDEyOjEzOjA0L
        Y2NFoiIFZlcnNpb249IjIuMCI+PHNhbWwyOklzc3VlciB4bWxuczpzYW1sMj0idXJuOm9hc2lzOm5hbWVzOnRjOlN
        TUw6Mi4wOmFzc2VydGlvbiI+aHR0cDovL3BvcnRhbC5hcnh1cy5jb208L3NhbWwyOklzc3Vlcj48c2FtbDI6U3Via
        mVjdCB4bWxuczpzYW1sMj0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wO
        mFzc2VydGlvbiI+PHNhbWwyOk5hbWVJRCBGb3JtYXQ9InVybjpvYXNpczpuY
        W1lczp0YzpTQU1MOjEuMTpuYW1laWQtZm9ybWF0OmVtYWlsQWRkcmVzcyI+b
        HVjYXNmckBzb2ZmaWQucG9jPC9zYW1sMjpOYW1lSUQ+PC9zYW1sMjpTdWJqZ
        WN0Pjwvc2FtbDJwOkF1dGhuUmVxdWVzdD4="
}, 
    "url": "https://stasts-sof.arxus.eu/adfs/ls/"

}
```

# parse-saml-response

##### Definition

- This operation allows to validate a SAML response generated by another external IDP that support SAML protocol.

##### URL

- &lt;console-domain&gt;/webservice/federation/rest/parse-saml-response

##### Method

- POST

##### Headers

- Accept = “application/json”
- Content-Type = “application/json”

##### Authentication

- Use an account with **[federation:serviceProvider](http://federationserviceprovider/)** permission

##### Request (URL parameter)

- autoProvision → \[false|true\] (currently only false functionality is implemented)
- response
    
    
    - RelayState → identifier of the ticket of the SAML response
    - SAMLResponse → encoded SAML response
- protocol → use always “[urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST](http://urnoasisnamestcsaml:2.0:bindings:HTTP-POST)”
- serviceProviderName → service provider which requests the user authentication

```western
{
    "autoProvision" : false,
    "response" : {
        "RelayState": "_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2",
        "SAMLResponse": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ
        wOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1sMnA9InVybjpvYXNpczpuYW1lczp
        0YzpTQU1MOjIuMDpwcm90b2NvbCIgQXNzZXJ0aW9uQ29uc3VtZXJTZXJ2aWN
        lSW5kZXg9IjEiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9hYmM6NDQzLy94eHgiIERlc3Rpb
        mF0aW9uPSJodHRwczovL3N0YXN0cy5hcnh1cy5ldS9hZGZzL2xzLyIgRm9yY2VBdXRobj0iZmFsc2UiIElEPSJfNTI
        zODY2MjQyZjk0M2I0YzYzMjM0ZGM4OTQyZmZjMmYwOGNlYTAzYWExMjlhNGU
        yIiBJc3N1ZUluc3RhbnQ9IjIwMTctMTItMjJUMTQ6NTU6MjAuODYyWiIgUHJvdG9jb2xCaW5kaW5nPSJ1cm46b2Fza
        XM6bmFtZXM6dGM6U0FNTDoyLjA6YmluZGluZ3M6SFRUUC1SZWRpcmVjdCIgV
        mVyc2lvbj0iMi4wIj48c2FtbDI6SXNzdWVyIHhtbG5zOnNhbWwyPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA
        6YXNzZXJ0aW9uIj5odHRwOi8vcG9ydGFsLmFyeHVzLmNvbTwvc2FtbDI6SXN
        zdWVyPjxzYW1sMjpTdWJqZWN0IHhtbG5zOnNhbWwyPSJ1cm46b2FzaXM6bmF
        tZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj48c2FtbDI6TmFtZUlEIEZvcm1
        hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6cGVyc2lzdGVudCI+
        ZWRtb25kLmhhbGxleTwvc2FtbDI6TmFtZUlEPjwvc2FtbDI6U3ViamVjdD48L3NhbWwycDpBdXRoblJlcXVlc3Q+"
    },
    "protocol" : "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
    "serviceProviderName" : "https://stasts.arxus.eu/adfs/ls/"
}
```

##### Response (JSON)

- authentication → \[yes|no\]
- failureMessage → if authentication=”no”, a description text of the error
- principalName → account name
- user → account owner identity standard attributes
- attributes → account owner identity custom attributes
- sessionId → session identifier

# generate-saml-logout-request

##### Definition

<div id="bkmrk-this-operation-allow"><div>- This operation allows to generate a SAML logout request to be sent to a IdP supporting SAML Global Logout, including Soffid IdP.

</div></div>##### URL

<div id="bkmrk-%3Cconsole-domain%3E%2Fweb"><div>- &lt;console-domain&gt;/webservice/federation/rest/generate-saml-logout-request

</div></div>##### Method

<div id="bkmrk-post"><div>- POST

</div></div>##### Headers

<div id="bkmrk-accept-%3D-%E2%80%9Capplicatio"><div>- Accept = “application/json”
- Content-Type = “application/json”

</div></div>##### Authentication

<div id="bkmrk-use-an-account-with%C2%A0"><div>- Use an account with **federation:serviceProvider** permission

</div></div>##### Request *(URL parameter)*

<div id="bkmrk-user-%E2%86%92-id-of-the-use"><div>- user → Id of the user to log out
- force → set to false if you want to give a chance to the end user to abort logout process. Set to true otherwise.
- backChannel → set to true if you want to send the logout process via SOAP to the identity provider. Set to false if you want to send the logout process using a Redirect or HTML Form. The later allows interaction between the end user and the identity provider.
- serviceProviderName → service provider that notifies user logout
- identityProvider → identity provider to send the logout request

</div></div>##### Response *(JSON)*

<div id="bkmrk-parameters-%E2%86%92-paramet"><div>- parameters → parameters to send to identity provider.
    
    
    - RelayState → identifier of the request id
    - SAMLRequest → encoded SAML request
- method → method to use: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST, urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect or urn:oasis:names:tc:SAML:2.0:bindings:SOAP
- url → url where to send the request

</div></div>##### Samples

Sample request

```
{
    "user": "my-id",
    "force": true,
    "backChannel": false,
    "serviceProviderName":"my-identity-provider",
    "identityProvider":"http://idp.soffid.com"
}
```

Sample response

```
{
    "url":"https://idp.soffid.com/SAML/SLO/SOAPBinding",
    "method":"urn:oasis:names:tc:SAML:2.0:bindings:SOAP",
    "parameters": {
        "RelayState":"_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2",
        "SAMLResponse": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ...."
    }
}
```

Sample redirect method made by service provider (urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect method)

```
HTTP/1.1 302 Found
Location: https://idp.soffid.com/SAML/SLO/RedirectBinding?RelayState=_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2&SAMLRequest=PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ....
 
```

Sample html form made by service provider (urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST method)

```
<html>
    <body onLoad="document.forms[0].submit();">
        <form action="https://idp.soffid.com/SAML/SLO/PostBinding">
            <input type="hidden" name="RelayState" value="_523866242f943b4c63234dc8942ffc2f08cea03aa129a4e2"/>
            <input type="hidden" name="SAMLRequest" value="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJ..."/>
        </form>
    </body>
</html>
```

Sample SOAP request ( urn:oasis:names:tc:SAML:2.0:bindings:SOAP method ). Service provader decodes SAMLRequest, and includes it in a SOAP message.

```
POST /SAML/SLO/SoapBinding HTTP/1.1
Host: idp.soffid.com
Content-Type: text/xml
Content-Length: ....
SOAPAction: http://www.oasis-open.org/committees/security
 
<SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/”>
 <SOAP-ENV:Body>
   <samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="d2b7c388cec36fa7c39c28fd298644a8" IssueInstant="2004-01-21T19:00:49Z" Version="2.0">
     <Issuer>your-identity-provider</Issuer>
     <NameID Format="urn:oasis:names:tc:SAML:2.0:nameidformat:persistent">005a06e0-ad82-110d-a556-004005b13a2b</NameID>
     <samlp:SessionIndex>1</samlp:SessionIndex>
   </samlp:LogoutRequest>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
```

</body></html>

# Connecting Office 365

## Introduction

You can use an Identity Provider defined into Soffid to connect to Office 365. You only need to register the Office 365 metadata into a Soffid Service Provider and register the Identity Provider Metadata into your Office 365.

At this tutorial Soffid explain how to connect to Office 365 using PowerShell.

## Step By Step

### Attribute definition

Review the attribute definition to check if it will be necessary to add the Required attributes.

<p class="callout info">[*https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp*](https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp)</p>

### Attribute sharing policies

Review the attribute sharing policies to add the required attributes.

### Option 1

Soffid will be in charge of creating users in Office 365.

1\. First of all, you need to configure your **Identity Provide**r, in that case, we configure Soffid as Identity Provider.

[![image-1644228339942.png](https://bookstack.soffid.com/uploads/images/gallery/2022-02/scaled-1680-/image-1644228339942.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-02/image-1644228339942.png)

[![image-1644228359906.png](https://bookstack.soffid.com/uploads/images/gallery/2022-02/scaled-1680-/image-1644228359906.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-02/image-1644228359906.png)

2\. Then, you need to configure the **Service provider**. It will be mandatory to copy the Metadata of Office 365 into the Service Configuration.

[![image-1644228483247.png](https://bookstack.soffid.com/uploads/images/gallery/2022-02/scaled-1680-/image-1644228483247.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-02/image-1644228483247.png)

3\. You need to configure an Office 365 agent: [https://bookstack.soffid.com/books/connectors/page/how-to-configure-the-office-365-agent](https://bookstack.soffid.com/books/connectors/page/how-to-configure-the-office-365-agent)

### <span style="font-weight: 400;">Option 2</span>

<span style="font-weight: 400;">The Active Directory will be in charge of creating users in Office 365.</span>

<span style="font-weight: 400;">1. You need to create the attribute *inmutableId* in the agent configuration</span>

[![image-1681898221429.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681898221429.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681898221429.png)

If you fetch the Soffid object, Soffid will display this new attribute

[![image-1681898371943.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681898371943.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681898371943.png)

2\. You must add a UID Script in the Office 365 Service Provider

[![image-1681898502855.png](https://bookstack.soffid.com/uploads/images/gallery/2023-04/scaled-1680-/image-1681898502855.png)](https://bookstack.soffid.com/uploads/images/gallery/2023-04/image-1681898502855.png)

```JavaScript
System.out.printlin("Guessing immutable id for " + id + "/" + userName);
for (account: serverService.getUserAccounts(id, "ActiveDirectoryDemoLab")) {
  if (account.attributes{"immutableId"} != null) 
    return account.attributes{"immutableId"};
}
```

### <span style="font-weight: 400;">PowerShell</span>

<span style="font-weight: 400;">If necessary you can install the Azure AD module for Windows PowerShell</span>

```Powershell
Install-Module MSOnline
```

<span style="font-weight: 400;">Then you can connect to the service</span>

```shell
Connect-MsolService
```

When you executed the connect method, a new window will open to login Microsoft in as an administrator domain user.

[![image-1643903332457.png](https://bookstack.soffid.com/uploads/images/gallery/2022-02/scaled-1680-/image-1643903332457.png)](https://bookstack.soffid.com/uploads/images/gallery/2022-02/image-1643903332457.png)

Once you have logged in, you could execute some commands to configure the connection to Office 365:

- **Register-PSRepository -Default:** registers a PowerShell repository
- **Get-MsolDomain**: displays the registered domains in Azure Active Directory.
- **GetMsolDomainFederationSettings**: get the settings for a federated domain
- **Set-Msoldomain -Name &lt;YOUR\_DOMAIN&gt; -isdefault**: set as default one domain
- **Set-MsolDomainAuthentication -DomainName &lt;YOUR\_DOMAIN&gt; -Authentication federated**: set as federated a specific domain.

In order to connect to Office 365, one can use the following script:

```shell
$dom = "<Your demain>"
$BrandName = "<Your company>"
$LogOnUrl = "https://<Your Soffid IdP>/profile/SAML2/POST/SSO"
$LogOffUrl = "https://<Your Soffid IdP>/profile/SAML2/POST/SLO"
$ecpUrl = "https://<Your Soffid IdP>/SAML2/POST/PAOS"
$MyURI = "<Your Soffid IdP>"
$MySigningCert = "<Your certificate in Base64>";
# "MIIGaDCCBVCgAwIBAgIQAWdkq9pxzP/bK+Mlym5y5zANBgkqhkiG9w0BAQsFADBeMQswCQY....
$Protocol = "SAMLP"
 
# To enable
Set-MsolDomainAuthentication -DomainName $dom -FederationBrandName $BrandName -Authentication Federated -PassiveLogOnUri $LogOnUrl -SigningCertificate $MySigningCert -IssuerUri $MyURI -LogOffUri $LogOffUrl -PreferredAuthenticationProtocol $Protocol
 
# To disable
# Set-MsolDomainAuthentication -DomainName $dom -Authentication Managed
```

---

[*https://docs.microsoft.com/en-us/powershell/module/cimcmdlets/?view=powershell-7.2*](https://docs.microsoft.com/en-us/powershell/module/cimcmdlets/?view=powershell-7.2)

*[https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-msonlinev1?view=azureadps-1.0#install-the-azure-ad-module](https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-msonlinev1?view=azureadps-1.0#install-the-azure-ad-module)*

[*https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp*](https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-saml-idp)

# Server certificate management

There are two options for certificate management

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1. </span>The easiest, fast and cheap one: Do not create any public or private key, nor enter any certificate chain. At first start up, Soffid Identity Provider will generate a new public/private key pair. Using this key, Soffid IdP will create a self-signed certificate and will store it on the certificate chain field.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2. </span>The secure one:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.1. </span>Create a public/private key.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.2. </span>Generate a PKCS#10 file. Use this file to ask for a certificate to a well known certificate authority.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.3. </span>After some paper work, the certificate authority will give you a valid certificate.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.4. </span>The certificate can be in PEM or DER format. If it's in PEM format, it will start with a line saying

\------BEGIN CERTIFICATE ----  
In such a case, just paste its contents on certificate chain field.  
If it's in binary DER format, you can use openssl to convert it from PEM to DER:  
<span style="color: #0000ff;">openssl x509 -in &lt;DER-FILE&gt; -inform DER -out &lt;PEM-FILE&gt; -outform PEM</span>  
Sometimes your CA will give you a base64 encoded DER file. In such a case, convert it to PEM using:  
<span style="color: #0000ff;">openssl base64 -d &lt;DEF-FILE&gt; | openssl x509 -inform DER -out &lt;PEM-FILE&gt; -outform PEM</span>

# Identity Broker



# Soffid IdP as an identity broker

## Introduction

> An Identity Broker is often part of a a Single Sign-On Architecture as an an intermediary service that connects multiple Service Providers with different Identity Provider (IDP)s.​

Soffid IdP can act as an identity broker. This means that Soffid IdP can rely on third party identity providers to identify users.

<p class="callout info">To act as an identity broker, the External SAML identity provider option must be enabled on the Authentication page. You can visit the [Authentication page](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/authentication "Authentication") for more info.</p>

## Data flow

The following diagram, shows the resulting data flow between the end user, your application, the identity provider and Soffid web services:

<div drawio-diagram="482"><img src="https://bookstack.soffid.com/uploads/images/drawio/2021-10/drawing-5-1633685843.png" alt=""/></div>

### Data flow steps

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">1.</span> Web browser requests a protected web application resource.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">2.</span> Web application builds a SAML authentication request and forwards it to Soffid IdP.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">3.</span> Soffid IdP receives SAML authentication request and validates it. A user name and password page is presented. This page can optionally contain a set of links to third-party identification servers.

If the user clicks on the third party identification server link, or the typed in user name is expected to be authenticated by a third-party IdP. Soffid IdP acts as a Service Provider and an authentication request is forwarded to that IdP. The authentication request format depends on the protocol required by the third-party IdP.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">4.</span> Third-party IdP receives the authentication request and presents the user its user name and password page.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">5.</span> User fills in the user name and password form.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">6.</span> Third-party IdP builds an authentication response that is forwarded to Soffid IdP. This response can contain a SAML Assertion or a oAuth authorization token.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.</span> Soffid IdP parses and validates the received response:

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.1.</span> For SAML responses, the assertion is validated and identity attributes are extracted.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.1.</span> For oAuth responses, the authorization token is used to get a session token. Next, session token is used to fetch user attributes from external IdP.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">7.1.</span> For OpenID-Connect responses, the authorization token is used to get a session token along the OpenID token received. The OpenID token is parsed as a JWT token, and each claimed attribute is parsed.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">8.</span> Soffid IdP finds the identity owner of the external identity. If no identity is found, depending on Soffid IdP configuration, it can automatically create a Soffid Identity based on received attributes.

<span style="color: #a6d100; font-weight: bold; font-size: 18px;">9.</span> Finally, Soffid IdP issues a SAML assertion containing Soffid identity attributes.

---

[*https://ldapwiki.com/wiki/Identity%20Broker*](https://ldapwiki.com/wiki/Identity%20Broker)

# External oAuth / OpenID Identity Providers

## Introduction

Soffid federation can be composed by a mix of SAML and oAuth / OpenID-connect servers. In such a scenario, Soffid IdP is able to let users be identified by oAuth servers like Linked-in, Google or Facebook, perform all the provision tasks required and send back a SAML assertion to the service provider requiring user authentication.

![](https://bookstack.soffid.com/uploads/images/gallery/2021-11/embedded-image-g5h5py7w.png)

To create an external oAuth identity provider, you can choose the Idp type from a list of popular sites, like Google or Facebook, or write you own descriptor.

The descriptor should follow the OpenID connect discovery JSON document. Most parameters are optional, but these are required:

- **authorization\_endpoint**: contains the oAuth endpoint to forward the user to get the authorization token.
- **token\_endpoint**: contains the oAuth endpoint to get the access token, based on the authorization token got at previous step.
- **userinfo\_endpoint**: if remote IdP is OpenID-connect compliant, the token endpoint should have sent an access token along a JWT OpenID token containing user claims. If this is not the case, Soffid will use this user\_info endpoint to fetch user claims. This mechanism is needed for oAuth2 servers.
- **scopes\_sopported**: The list of scopes specified here will be used at first step, when redirecting the user to the authorization endpoint.

Next, you must register Soffid IdP with your oAuth server. After registering, you will get a oAuthKey (some kind of username) and an oAuthSecret (some kind of password). To register Soffid IdP, your oAuth server will require you to specify the redirection endpoint. This redirection endpoint refers to your Soffid IdP and will receive the authorization token generated by the oAuth server.

If your Soffid IdP is listening to https://idp.yourdomain.com:2443/, your redirection endpoint will be https://idp.yourdomain.com:2443/**oauthResponse**

As an example, here you have some links to get your oAuth keys and secrets for [Google](https://console.developers.google.com/), [Facebook](https://developers.facebook.com/apps/) and [Linkedin](https://www.linkedin.com/secure/developer?newapp=).

# Holder group login



# Holder group login

<span style="color: rgb(34, 34, 34); font-family: var(--font-heading, var(--font-body)); font-size: 2.8275em; font-weight: 400;">Introduction</span>

In some organizations is necessary to assign roles that affect only a part of the structure, for instance, a department, a division or a country. A **Holder Group** can be defined as a collection of entities (referred to as "holders") that share similar characteristics, roles, permissions, or access requirements. The concept of a Holder Group simplifies the management of identities by enabling administrators to apply policies, assign roles, and manage permissions at the group level rather than individually.

The Soffid federation allows a new way to login, the **Holder group login**. This new way, allows the user to login to applications, Service Provider, indicating with which group the user wants to log in. Soffid will share with the application the roles and permissions according to the selected group.

If you want an application to allow Holder group login, the option Ask for group membership after authentication of the Service Provider must be activated (Yes option selected).

Once the user has logged in using the federation, Soffid will share with the Service Provider application the following information:

- **Holder group**: Group selected by the user when logging in.
- **Roles list**: 
    - Roles directly assigned to the user.
    - Roles assigned to the user in compliance with a Role Assignment Rule.
    - Roles assigned in the group selected by the user when logging in.
- **Scope**: the scope will be shared when you try to log in using OpenID-Connect.

### How Holder group login works?

**1.** The user is not logged in to the Identity Provider.

**1.1.** The user type the user and password into the Identity Provider.

**1.2.** The Identity Provider validates the user credentials, and requires a 2FA if it is necessary.

**1.2.1.** If the credentials are not correct, an error message is displayed.

**1.2.2.** If the credentials are correct, the Identity Provider get a list of all groups to which the user can log in. This list is obtained by selecting all groups, primary and/or secondary, that have as type one with Rol holder Yes. The groups are not repeated in this list.

**1.2.2.1.** If there is no group with these characteristics, the Identity Provider automatically logs the user, and shares the data with the Service Provider.

**1.2.2.2.** If there is only one group with these characteristics, the Identity Provider automatically logs the user into this group, and shares the data with the Service Provider.

**1.2.2.3.** If there is more than one group, the Identity Provider displays a list of the groups for the user to select which one to log in to. Here the user selects the group and logs in, then Identity Provider shares the updated data with the Service Provider.

**2.** The user is already logged in to the Identity Provider.

**2.1.** The user login to a new application, Service Provider.

**2.2.** The Identity Provider checks if there are any additional adaptive rules required to perform the login.

**2.2.1.** If the credentials are not correct, an error message is displayed.

**2.2.2.** If the credentials are correct, the user logs in to the application with the group to which the user was previously logged in. The Identity Provider shares the updated data with the Service Provider, so if there have been any changes in the user's roles, these updates are reflected in the shared data.

### Service providers that allow Holder group login

The following Service Providers allow you to configure the login with Holder group

- SAML
- SAML API client
- OpenID-Connect
- CAS client

# Steps to configure

## Steps to configure

**1**. **Group type:** Create at least one organizational unit with the role holder attribute active (yes).

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/L4LUdou2xWfqk6ug-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/L4LUdou2xWfqk6ug-image.png)

[*https://bookstack.soffid.com/books/soffid-3-reference-guide/page/group-type*](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/group-type)

**2. Groups:** Assign Groups to the organizational unit. Define groups with the appropriate group type.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/hc6QKTrCkOkR72mp-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/hc6QKTrCkOkR72mp-image.png)

[*https://bookstack.soffid.com/books/soffid-3-reference-guide/page/groups*](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/groups)

**3. Custom attributes:** (Optional) You can include new custom attributes to this membership relationship, go to Metadata page and select the GroupUser to add these attributes.

**4. Attribute definition:** Define the **Attributes to deliver** from the identity providers to the service providers

4.1. Holder group

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/LMDZvT2JNV6CL7pg-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/LMDZvT2JNV6CL7pg-image.png)

4.2. Role &amp; group membership

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/QUL4LW17BGSwBW0N-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/QUL4LW17BGSwBW0N-image.png)

**5. Attribute sharing policies:** Define the policies to share the attributes with each service provider.

In this case, the Holder group, and Role &amp; group membership attributes will be always shared.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/UjRCTQjRBGXzi5wQ-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/UjRCTQjRBGXzi5wQ-image.png)

**6. Service Provider:** Configure the service providers, indicating in which ones the headline group should be requested[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/POAwtVnvJtwN0PsP-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/POAwtVnvJtwN0PsP-image.png)

# Use cases

## Premises

1\. An Organizational Unit has been defined as Role holder Yes.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/uBE1WkFeIyqz9D95-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/uBE1WkFeIyqz9D95-image.png)

2\. Several groups have been defined with type organizational unit with role holder Yes.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/A92Ke2fzOpFX6yD2-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/A92Ke2fzOpFX6yD2-image.png)

3\. An attribute sharing policy has been defined.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/RGnCcbn4hHQUBIpq-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/RGnCcbn4hHQUBIpq-image.png)

4\. Indicates which Service Providers will be required group membership after authentication.

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/qHiJkgYhtK3yyHm4-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/qHiJkgYhtK3yyHm4-image.png)

## Use cases

### Use case 1 - Log in to an application

User with no groups, Primary or Secundary, with type holder group Yes. When this user log into an application --&gt; The user login normally to the application

### Use case 2 - Log in to an application


User with only one group, Primary or Secondary, with type holder group Yes. This users can have more groups with holder group No. When this user logs in to an application --&gt; The user will be loged-in the application with the group with type holder group yes.

#### OpenID-Connect

<details id="bkmrk-a.-user-agatha-with-"><summary>a. User Agatha with Primary group RRHH (Role holder Yes)</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/wVj0opxxR3dP9bif-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/wVj0opxxR3dP9bif-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/DKsM0v7zbaUVoTIp-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/DKsM0v7zbaUVoTIp-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/Lhd6oG4JhxMS3oo7-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/Lhd6oG4JhxMS3oo7-image.png)

</details><details id="bkmrk-b.-login%3A-the-user-t"><summary>b. Login: the user type the user and password to login</summary>

 [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/cYxBAw9La5gqsMkg-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/cYxBAw9La5gqsMkg-image.png)

</details><details id="bkmrk-c.-get-the-json-id_t"><summary>c. Get the JSON id\_token</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/fiFRnrsRiyM73Pff-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/fiFRnrsRiyM73Pff-image.png)

</details><details id="bkmrk-d.-decode-the-json-w"><summary>d. Decode the JSON Web Token using https://jwt.io</summary>

Here you are the scope, the holder\_group and the member\_of data

```json
{
  "sub": "agatha",
  "iss": "https://sync-server.netcompose:1443",
  "holder_group": "RRHH",
  "meber_of": [
    "SOFFID_HOLDER_CONDOMAIN004/RRHH@soffid",
    "SOFFID_HOLDER_CONDOMAIN005/Philosophers@soffid",
    "SOFFID_VAULT_USER@soffid",
    "SOFFID_HOLDER_CONDOMAIN004/Writers@soffid",
    "SOFFID_USER@soffid"
  ],
  "nonce": null,
  "sid": "oeB51Jr/+rb5yE+lbG9iYsAHy1TxOFYm",
  "aud": "angularApp",
  "azp": "angularApp",
  "auth_time": 1737365621,
  "scope": "openid profile email",
  "exp": 1737366221,
  "iat": 1737365622,
  "jti": "WW1wwRD-HaE9DCXfQv4wLRuFgGRbI1lB_9wDFBd6X4ILJBv4vS6mL1yG3S0Ee_Nv",
  "email": "agatha@soffid.com"
}
```

</details>#### SAML

<details id="bkmrk-a.-user-agatha-with--1"><summary>a. User Agatha with Primary group RRHH (Role holder Yes)</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/wVj0opxxR3dP9bif-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/wVj0opxxR3dP9bif-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/DKsM0v7zbaUVoTIp-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/DKsM0v7zbaUVoTIp-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/Lhd6oG4JhxMS3oo7-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/Lhd6oG4JhxMS3oo7-image.png)

</details><details id="bkmrk-b.-login%3A-the-user-t-1"><summary>b. Login: the user type the user and password to login</summary>

 [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/0XVHTuj0qlc1pPAQ-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/0XVHTuj0qlc1pPAQ-image.png) [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/IAd2whZ8P5Pzopmt-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/IAd2whZ8P5Pzopmt-image.png)

</details><details id="bkmrk-c.-get-the-saml-resp"><summary>c. Get the SAML response</summary>

```xml
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://pat.soffid.lab:8443/soffid/saml/log/post" ID="_6699870c490dcef896cb33d70187de62" InResponseTo="_edec4bcc9b7bf081e970867995369df9" IssueInstant="2025-01-20T09:35:53.249Z" Version="2.0">
 <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://sync-server.netcompose</saml2:Issuer>
 <saml2p:Status>
  <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"></saml2p:StatusCode>
 </saml2p:Status>
 <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema" ID="_8d730eeaaa1bcfbf419568e5edc77d27" IssueInstant="2025-01-20T09:35:53.249Z" Version="2.0">
  <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://sync-server.netcompose</saml2:Issuer>
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
   <ds:SignedInfo>
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
    <ds:Reference URI="#_8d730eeaaa1bcfbf419568e5edc77d27">
     <ds:Transforms>
      <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>
      <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
       <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"></ec:InclusiveNamespaces>
      </ds:Transform>
     </ds:Transforms>
     <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
     <ds:DigestValue>qEEAkYqFFZxatl6DaVme4IfrojC3zafaKFH+TpIDurY=</ds:DigestValue>
    </ds:Reference>
   </ds:SignedInfo>
   <ds:SignatureValue>TeVSWaALsRLMwYxi71/b1k8jKYOrFb7qS9qva2T5T3yKpNLwZxnmRqWznbBM7wpr9U3V0scfh5M1ex/NGflbADbxih7uwUVK8YSAZPwIx/4LXEx0uOxpQi7ZiDOvhb2jkKLdvztvUkBGeJhJGCJy/2WrOHIEdzsn4T4c7TBdWZc=</ds:SignatureValue>
   <ds:KeyInfo>
    <ds:X509Data>
     <ds:X509Certificate>MIICKTCCAZKgAwIBAgIGAY3q71O5MA0GCSqGSIb3DQEBCwUAMFgxJzAlBgNVBAMMHmh0dHBzOi8v
c3luYy1zZXJ2ZXIubmV0Y29tcG9zZTEcMBoGA1UECwwTRmVkZXJhdGlvbiBzZXJ2aWNlczEPMA0G
A1UECgwGU09GRklEMB4XDTI0MDIyNzE0MjkyOVoXDTM0MDIyNzE0MjkyOVowWDEnMCUGA1UEAwwe
aHR0cHM6Ly9zeW5jLXNlcnZlci5uZXRjb21wb3NlMRwwGgYDVQQLDBNGZWRlcmF0aW9uIHNlcnZp
Y2VzMQ8wDQYDVQQKDAZTT0ZGSUQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJZ5G9BnTSLh
X8VOVbdyY01EUkgHexi97+e1iGA0r1WM6cTu4Ku3k7/efIB5ZZfteRKbPwa719y8Ytb5W4RFcZ6O
XzHz9o+FhG64tZHEo4xwVdukv6rOatSSlhomEhruhxX+x7OpFnnlXNSCypi1xjEQyIm8GJKxpxjk
RJvkgfXLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEATbs8iLBYEcPdPBjtmNHYrQpXb3nc83Acmxyy
/pEe4hXaMoB1rBuxNf47IiqJaJld9H6k5oXWcGgG8FyrdOxpY3eE8cw1s+6tM/MACMRuhuV4bQhR
FD1aizcW6fQUfvmkRLUgS1o8BMZZjCWW22FPeSklFXATE/FvmncRGpT9JWs=</ds:X509Certificate>
    </ds:X509Data>
   </ds:KeyInfo>
  </ds:Signature>
  <saml2:Subject>
   <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" NameQualifier="https://sync-server.netcompose">Agatha</saml2:NameID>
   <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
    <saml2:SubjectConfirmationData Address="172.18.0.1" InResponseTo="_edec4bcc9b7bf081e970867995369df9" NotOnOrAfter="2025-01-20T09:40:53.249Z" Recipient="https://pat.soffid.lab:8443/soffid/saml/log/post"></saml2:SubjectConfirmationData>
   </saml2:SubjectConfirmation>
  </saml2:Subject>
  <saml2:Conditions NotBefore="2025-01-20T09:35:53.249Z" NotOnOrAfter="2025-01-20T09:40:53.249Z">
   <saml2:AudienceRestriction>
    <saml2:Audience>https://pat.soffid.lab:8443/soffid-iam-console</saml2:Audience>
   </saml2:AudienceRestriction>
  </saml2:Conditions>
  <saml2:AuthnStatement AuthnInstant="2025-01-20T09:35:53.197Z" SessionIndex="_cd9afa8aac3a7a35abc90b488b01d458">
   <saml2:SubjectLocality Address="172.18.0.1"></saml2:SubjectLocality>
   <saml2:AuthnContext>
    <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
   </saml2:AuthnContext>
  </saml2:AuthnStatement>
  <saml2:AttributeStatement>
   <saml2:Attribute FriendlyName="mail" Name="urn:oid:0.9.2342.19200300.100.1.3" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">agatha@soffid.com</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Agatha</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="memberOf" Name="urn:oid:1.3.6.1.4.1.5923.1.5.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_HOLDER_CONDOMAIN004/RRHH@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_HOLDER_CONDOMAIN005/Philosophers@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_VAULT_USER@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_HOLDER_CONDOMAIN004/Writers@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_USER@soffid</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="HolderGroup" Name="urn:oid:1.3.6.1.4.1.22896.3.1.7" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">RRHH</saml2:AttributeValue>
   </saml2:Attribute>
  </saml2:AttributeStatement>
 </saml2:Assertion>
</saml2p:Response>

```

</details>### Use case 3 - Log in to an application

User with more than one group, Primary or Secondary, with type holder group Yes. When this user log into an application --&gt; The user will have to choose the holder group to login the application. The user will be loged-in the application with the holder group selected.

#### OpenID-Connect

<details id="bkmrk-a.-user-agatha-with--2"><summary>a. User Agatha with three groups with Role holder Yes</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/DdleFWxWsjYqmSza-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/DdleFWxWsjYqmSza-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/epmuYcCCnY1a3yWN-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/epmuYcCCnY1a3yWN-image.png)

</details><details id="bkmrk-b.-login%3A-the-user-t-2"><summary>b. Login: the user type the user and password to login</summary>

 [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/cYxBAw9La5gqsMkg-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/cYxBAw9La5gqsMkg-image.png)

</details><details id="bkmrk-c.-the-user-has-to-s"><summary>c. The user has to select the holder group to login</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/xyb5gUqjS8s7dp0q-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/xyb5gUqjS8s7dp0q-image.png)

</details><details id="bkmrk-d.-get-the-json-id_t"><summary>d. Get the JSON id\_token</summary>

 [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/fiFRnrsRiyM73Pff-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/fiFRnrsRiyM73Pff-image.png)

</details><details id="bkmrk-e.-decode-the-json-w"><summary>e. Decode the JSON Web Token using https://jwt.io</summary>

Here you are the scope, the holder\_group and the member\_of data

```json
{
  "sub": "agatha",
  "iss": "https://sync-server.netcompose:1443",
  "holder_group": "Marketing",
  "meber_of": [
    "SOFFID_VAULT_USER@soffid",
    "SOFFID_HOLDER_CONDOMAIN005/Writers@soffid",
    "SOFFID_USER@soffid"
  ],
  "nonce": null,
  "sid": "+cr0VQjIUcwmuJg0jraIO4DwtPfFOH9b",
  "aud": "angularApp",
  "azp": "angularApp",
  "auth_time": 1737366858,
  "scope": "openid profile email",
  "exp": 1737367458,
  "iat": 1737366858,
  "jti": "X1kvNUqr_-LJgz_EHneva0-mtHTLSkhN00d3UX-dtA7LVcjpkyM0yvl5UPst9vV2",
  "email": "agatha@soffid.com"
}
```

</details>#### SAML

<details id="bkmrk-a.-user-agatha-with--3"><summary>a. User Agatha with three groups with Role holder Yes</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/DdleFWxWsjYqmSza-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/DdleFWxWsjYqmSza-image.png)

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/epmuYcCCnY1a3yWN-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/epmuYcCCnY1a3yWN-image.png)

</details><details id="bkmrk-b.-login%3A-the-user-t-3"><summary>b. Login: the user type the user and password to login</summary>

 [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/0XVHTuj0qlc1pPAQ-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/0XVHTuj0qlc1pPAQ-image.png) [![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/IAd2whZ8P5Pzopmt-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/IAd2whZ8P5Pzopmt-image.png)

</details><details id="bkmrk-c.-the-user-has-to-s-1"><summary>c. The user has to select the holder group to login</summary>

[![image.png](https://bookstack.soffid.com/uploads/images/gallery/2025-01/scaled-1680-/xyb5gUqjS8s7dp0q-image.png)](https://bookstack.soffid.com/uploads/images/gallery/2025-01/xyb5gUqjS8s7dp0q-image.png)

</details><details id="bkmrk-c.-get-the-saml-resp-1"><summary>d. Get the SAML response</summary>

```xml
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://pat.soffid.lab:8443/soffid/saml/log/post" ID="_82e187f91ad03509cbb5adc502dc75ec" InResponseTo="_5ffefaae23a7626917de0e0d8c4866e5" IssueInstant="2025-01-20T09:56:45.504Z" Version="2.0">
 <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://sync-server.netcompose</saml2:Issuer>
 <saml2p:Status>
  <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"></saml2p:StatusCode>
 </saml2p:Status>
 <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema" ID="_f351bb2c2cb39df3eeb29f31f4e6ea02" IssueInstant="2025-01-20T09:56:45.504Z" Version="2.0">
  <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://sync-server.netcompose</saml2:Issuer>
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
   <ds:SignedInfo>
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
    <ds:Reference URI="#_f351bb2c2cb39df3eeb29f31f4e6ea02">
     <ds:Transforms>
      <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>
      <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
       <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"></ec:InclusiveNamespaces>
      </ds:Transform>
     </ds:Transforms>
     <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
     <ds:DigestValue>FIIpGC4P+i4OYv+1MxIw2tdgPgheB6zsE2QhbHTUP3U=</ds:DigestValue>
    </ds:Reference>
   </ds:SignedInfo>
   <ds:SignatureValue>VI2a9cx7vPKH+fppjyRQ4g+/NPknfxVzgbekaWomAxHvgNegRonlalUiRiiVLC5DdcT1dkO85c9FJgf5x8CgEfKFRKVNcaNWRVMZIZYUR/DKjyVH0F8a8lZMdHyxB9z3xj0QVqs7536dalA38hD5p4TG4PoNttYLhE1tFGd8QsI=</ds:SignatureValue>
   <ds:KeyInfo>
    <ds:X509Data>
     <ds:X509Certificate>MIICKTCCAZKgAwIBAgIGAY3q71O5MA0GCSqGSIb3DQEBCwUAMFgxJzAlBgNVBAMMHmh0dHBzOi8v
c3luYy1zZXJ2ZXIubmV0Y29tcG9zZTEcMBoGA1UECwwTRmVkZXJhdGlvbiBzZXJ2aWNlczEPMA0G
A1UECgwGU09GRklEMB4XDTI0MDIyNzE0MjkyOVoXDTM0MDIyNzE0MjkyOVowWDEnMCUGA1UEAwwe
aHR0cHM6Ly9zeW5jLXNlcnZlci5uZXRjb21wb3NlMRwwGgYDVQQLDBNGZWRlcmF0aW9uIHNlcnZp
Y2VzMQ8wDQYDVQQKDAZTT0ZGSUQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJZ5G9BnTSLh
X8VOVbdyY01EUkgHexi97+e1iGA0r1WM6cTu4Ku3k7/efIB5ZZfteRKbPwa719y8Ytb5W4RFcZ6O
XzHz9o+FhG64tZHEo4xwVdukv6rOatSSlhomEhruhxX+x7OpFnnlXNSCypi1xjEQyIm8GJKxpxjk
RJvkgfXLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEATbs8iLBYEcPdPBjtmNHYrQpXb3nc83Acmxyy
/pEe4hXaMoB1rBuxNf47IiqJaJld9H6k5oXWcGgG8FyrdOxpY3eE8cw1s+6tM/MACMRuhuV4bQhR
FD1aizcW6fQUfvmkRLUgS1o8BMZZjCWW22FPeSklFXATE/FvmncRGpT9JWs=</ds:X509Certificate>
    </ds:X509Data>
   </ds:KeyInfo>
  </ds:Signature>
  <saml2:Subject>
   <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" NameQualifier="https://sync-server.netcompose">Agatha</saml2:NameID>
   <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
    <saml2:SubjectConfirmationData Address="172.18.0.1" InResponseTo="_5ffefaae23a7626917de0e0d8c4866e5" NotOnOrAfter="2025-01-20T10:01:45.504Z" Recipient="https://pat.soffid.lab:8443/soffid/saml/log/post"></saml2:SubjectConfirmationData>
   </saml2:SubjectConfirmation>
  </saml2:Subject>
  <saml2:Conditions NotBefore="2025-01-20T09:56:45.504Z" NotOnOrAfter="2025-01-20T10:01:45.504Z">
   <saml2:AudienceRestriction>
    <saml2:Audience>https://pat.soffid.lab:8443/soffid-iam-console</saml2:Audience>
   </saml2:AudienceRestriction>
  </saml2:Conditions>
  <saml2:AuthnStatement AuthnInstant="2025-01-20T09:56:45.461Z" SessionIndex="_31bb4c1105aa3c363a69b299e577d9cd">
   <saml2:SubjectLocality Address="172.18.0.1"></saml2:SubjectLocality>
   <saml2:AuthnContext>
    <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
   </saml2:AuthnContext>
  </saml2:AuthnStatement>
  <saml2:AttributeStatement>
   <saml2:Attribute FriendlyName="mail" Name="urn:oid:0.9.2342.19200300.100.1.3" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">agatha@soffid.com</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Agatha</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="memberOf" Name="urn:oid:1.3.6.1.4.1.5923.1.5.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_VAULT_USER@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_HOLDER_CONDOMAIN005/Writers@soffid</saml2:AttributeValue>
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOFFID_USER@soffid</saml2:AttributeValue>
   </saml2:Attribute>
   <saml2:Attribute FriendlyName="HolderGroup" Name="urn:oid:1.3.6.1.4.1.22896.3.1.7" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
    <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Marketing</saml2:AttributeValue>
   </saml2:Attribute>
  </saml2:AttributeStatement>
 </saml2:Assertion>
</saml2p:Response>

```

</details>
### Use case 4 - Log in to a second application

<details id="bkmrk-a.-agatha-user-was-p"><summary>a. Agatha user was previously loged-in to an application</summary>

Agatha user is loged-in the angularApp Service Provider

```json
{
  "sub": "agatha",
  "iss": "https://sync-server.netcompose:1443",
  "holder_group": "Marketing",
  "meber_of": [
    "SOFFID_VAULT_USER@soffid",
    "SOFFID_HOLDER_CONDOMAIN005/Writers@soffid",
    "SOFFID_USER@soffid"
  ],
  "nonce": null,
  "sid": "+cr0VQjIUcwmuJg0jraIO4DwtPfFOH9b",
  "aud": "angularApp",
  "azp": "angularApp",
  "auth_time": 1737366858,
  "scope": "openid profile email",
  "exp": 1737367458,
  "iat": 1737366858,
  "jti": "X1kvNUqr_-LJgz_EHneva0-mtHTLSkhN00d3UX-dtA7LVcjpkyM0yvl5UPst9vV2",
  "email": "agatha@soffid.com"
}
```

</details><details id="bkmrk-b.-agata-user-is-log"><summary>b. Agata user is loged-in to a second application</summary>

 Agatha user is loged-in the OpenIDConnectApp001 Service Provider, with the same holder group

```json
{
  "sub": "agatha",
  "iss": "https://sync-server.netcompose:1443",
  "holder_group": "Marketing",
  "meber_of": [
    "SOFFID_VAULT_USER@soffid",
    "SOFFID_HOLDER_CONDOMAIN005/Writers@soffid",
    "SOFFID_USER@soffid"
  ],
  "nonce": null,
  "sid": "WDSQEzO6LIgxvQkq/zyIzL/LddKKy/j0",
  "aud": "OpenIDConnectApp001",
  "azp": "OpenIDConnectApp001",
  "auth_time": 1737367082,
  "scope": "openid",
  "exp": 1737367683,
  "iat": 1737367083,
  "jti": "C5xSE7UK0lgwgff5Cl7SPnpZvcRSm8WI0GZMXXObKdCMOuP50qbZjCcuGW7KpJqN",
  "email": "agatha@soffid.com"
}
```

</details>