|
| 1 | +# Openid FastFed |
| 2 | + |
| 3 | +The purpose of the OpenID FastFed standard is to simplify the administrative effort required to configure identity federation between a company's identity provider and a hosted application or application provider. |
| 4 | + |
| 5 | +Let’s consider an example: imagine a user working for an employer called "Company.com." The user discovers a tool at "onlineservice.com" that helps them be more productive. To use the tool, the user creates a local account using their work email address, "user@company.com." |
| 6 | + |
| 7 | +It is possible to use the work email address for authentication if a federation exists between the company’s identity provider and the application. However, configuring this federation can be time-consuming and complex, as it involves manual steps such as: |
| 8 | +* Creating an OpenID client in the company's identity server. |
| 9 | +* Updating and configuring the "onlineservice.com" website to use the newly created OpenID client. |
| 10 | +* And more... |
| 11 | + |
| 12 | +The OpenID FastFed standard simplifies this process, making it easier to establish federation between a hosted application and an identity provider. Once the federation is set up, the application can authenticate employees using Single Sign-On (SSO) via the company's Identity Server. Additionally, the application can receive user information from the company using provisioning protocols like SCIM. |
| 13 | + |
| 14 | +:::warning |
| 15 | + |
| 16 | +Currently, the SimpleIdServer project only supports identity provisioning via SCIM. Authentication protocols such as SAML are supported but not yet documented |
| 17 | + |
| 18 | +::: |
| 19 | + |
| 20 | +## SCIM Provisioning Workflow |
| 21 | + |
| 22 | +In this tutorial, we will use the OpenID FastFed standard to establish identity provisioning via SCIM between the application provider and the identity server. |
| 23 | + |
| 24 | +The workflow consists of the following steps, though it may vary depending on your use case: |
| 25 | + |
| 26 | +1. A worker visits the application provider (https://application.com) and enters their work email address (user@company.com) to create a local account. |
| 27 | + |
| 28 | +2. The application provider uses the email address to retrieve the webfinger of the company (https://company.com/.well-known/webfinger) and displays the list of OpenID FastFed endpoints. |
| 29 | + |
| 30 | +3. The worker selects the FastFed endpoint and submits their choice. |
| 31 | + |
| 32 | +4. The application provider fetches the capabilities of the selected endpoint (https://company.com/fastfed/provider-metadata) and displays them. |
| 33 | + |
| 34 | +5. The worker reviews the capabilities and confirms their choice. |
| 35 | + |
| 36 | +6. The worker is redirected to the registration endpoint of the company’s identity provider. |
| 37 | + |
| 38 | +7. The identity provider fetches the capabilities of the application provider (https://application.com/fastfed/provider-metadata) and displays them. |
| 39 | + |
| 40 | +8. The user clicks "Confirm" to complete the registration. |
| 41 | + |
| 42 | +9. The identity provider sends the registration result to the application provider. |
| 43 | + |
| 44 | +10. Finally, the application provider creates an OAuth client, which will be used by the identity provider to interact with the SCIM endpoint of the application. |
| 45 | + |
| 46 | +Once SCIM identity provisioning is established between the application provider and the identity server, the SCIM endpoint of the application will receive user information from the company. |
| 47 | + |
| 48 | +In the following chapters, we will implement this architecture. |
| 49 | + |
| 50 | +## Identity Server |
| 51 | + |
| 52 | +The identity server must be up and running. If you don't have one configured, you can use the [DOTNET Template](../installation/dotnettemplate#create-identityserver-project) to create the project. |
| 53 | + |
| 54 | +The message broker must be configured to use SQL Server as the transport. |
| 55 | +Open the `appsettings.json` file and ensure that `MessageBrokerOptions.Transport` is set to `SQLSERVER` and that the `MessageBrokerOptions.ConnectString` is correctly set. |
| 56 | + |
| 57 | +``` |
| 58 | + ... |
| 59 | + "MessageBrokerOptions": { |
| 60 | + "Transport": "SQLSERVER", |
| 61 | + "ConnectionString": "Data Source=.;Initial Catalog=MessageBroker;Integrated Security=True;TrustServerCertificate=True", |
| 62 | + "Username": "username", |
| 63 | + "Password": "password" |
| 64 | + }, |
| 65 | + ... |
| 66 | +``` |
| 67 | + |
| 68 | +For this tutorial, we assume that the Identity Server is listening on port 5001. |
| 69 | + |
| 70 | +``` |
| 71 | +dotnet run --urls=https://localhost:5001 |
| 72 | +``` |
| 73 | + |
| 74 | +## Administration Website |
| 75 | + |
| 76 | +The administration website must also be up and running. If you don't have one configured, you can use the [DOTNET Template](../installation/dotnettemplate#create-identityserver-website-project) to create the project. This website will be used by the administrator to add users. |
| 77 | + |
| 78 | +For this tutorial, we assume that the Administration website is listening on port 5002. |
| 79 | + |
| 80 | +``` |
| 81 | +dotnet run --urls=https://localhost:5002 |
| 82 | +``` |
| 83 | + |
| 84 | +## SCIM2.0 server |
| 85 | + |
| 86 | +The SCIM 2.0 server must be up and running. If you don't have one configured, you can use the [DOTNET Template](../installation/dotnettemplate#create-scim-project-with-ef-support). |
| 87 | +Once federation is established between the application and the identity provider, the SCIM 2.0 server will receive requests from the identity provider. |
| 88 | + |
| 89 | +For this tutorial, we assume that the SCIM server is listening on port 5003. |
| 90 | + |
| 91 | +``` |
| 92 | +dotnet run --urls=https://localhost:5003 |
| 93 | +``` |
| 94 | + |
| 95 | +## Fastfed application provider |
| 96 | + |
| 97 | +Follow these steps to create and configure the FastFed application provider: |
| 98 | + |
| 99 | +1. Open a command prompt and execute the following commands to create the directory structure for the solution: |
| 100 | + |
| 101 | +``` |
| 102 | +mkdir FastFed |
| 103 | +cd FastFed |
| 104 | +mkdir src |
| 105 | +dotnet new sln -n FastFed |
| 106 | +``` |
| 107 | + |
| 108 | +2. Create a web project named `FastFedApplicationProvider` with OpenID FastFed configured: |
| 109 | + |
| 110 | +``` |
| 111 | +cd src |
| 112 | +dotnet new fastfedappprov -n FastFedApplicationProvider |
| 113 | +``` |
| 114 | + |
| 115 | +3. Add the `FastFedApplicationProvider` project into your Visual Studio solution. |
| 116 | + |
| 117 | +``` |
| 118 | +cd .. |
| 119 | +dotnet sln add ./src/FastFedApplicationProvider/FastFedApplicationProvider.csproj |
| 120 | +``` |
| 121 | + |
| 122 | +Now that your web application is configured, you can launch it on port 5021: |
| 123 | + |
| 124 | +``` |
| 125 | +dotnet run --urls=https://localhost:5021 |
| 126 | +``` |
| 127 | + |
| 128 | +## FastFed Identity Provider |
| 129 | + |
| 130 | +Follow these steps to create and configure the FastFed identity provider: |
| 131 | + |
| 132 | +1. Create a web project named `FastFedIdProvider` with OpenID FastFed configured. The message broker will be set up to use SQL Server as the transport. Ensure that the `MessageBrokerOptions.ConnectionString` is the same as the one configured in the Identity Server. |
| 133 | + |
| 134 | +``` |
| 135 | +dotnet new fastfedidprov -n FastFedIdProvider --messageBrokerConnectionString "Data Source=.;Initial Catalog=MessageBroker;Integrated Security=True;TrustServerCertificate=True" --messageBrokerTransport "SQLSERVER" |
| 136 | +``` |
| 137 | + |
| 138 | +2. Add the `FastFedIdProvider` project into your Visual Studio solution. |
| 139 | + |
| 140 | +``` |
| 141 | +cd .. |
| 142 | +dotnet sln add ./src/FastFedIdProvider/FastFedIdProvider.csproj |
| 143 | +``` |
| 144 | + |
| 145 | +Now that your web application is configured, you can launch it on port 5020: |
| 146 | + |
| 147 | +``` |
| 148 | +dotnet run --urls=https://localhost:5020 |
| 149 | +``` |
| 150 | + |
| 151 | +## Enable SCIM provisioning |
| 152 | + |
| 153 | +Now that all the applications are running on your local machine, you can enable SCIM provisioning between the application provider and the identity provider. |
| 154 | + |
| 155 | +1. Navigate to the application provider at [https://localhost:5021](https://localhost:5021) and click on the `Authenticate` button. |
| 156 | + |
| 157 | +2. Log in with the following credentials: |
| 158 | + |
| 159 | +| Parameter | Value | |
| 160 | +| --------- | ------------- | |
| 161 | +| Login | administrator | |
| 162 | +| Password | password | |
| 163 | + |
| 164 | +3. After logging in, click on the `Configure provider` button. |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | +4. Enter the work email address `jane@localhost:5020` and click on the `Resolve` button. |
| 169 | + |
| 170 | +5. Select the `https://localhost:5020/fastfed` provider and click on the `Choose` button. |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +6. The application provider's capabilities will be displayed. Click on the `Confirm` button. |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | +7. You will be redirected to the identity provider for your company (localhost:5020). Click on the `Confirm` button to finalize the establishment of SCIM provisioning. |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | +8. On the next screen, configure the security for the SCIM client. Enter the following details and click on the`Update` button. |
| 184 | + |
| 185 | +| Parameter | Value | |
| 186 | +| --------- | ----- | |
| 187 | +| Authentication type | Api Key | |
| 188 | +| Api Secret | ba521b3b-02f7-4a37-b03c-58f713bf88e7 | |
| 189 | + |
| 190 | +## Enroll a User |
| 191 | + |
| 192 | +Now that SCIM provisioning is enabled, you can add a user and verify if they have been correctly enrolled via the SCIM API. |
| 193 | + |
| 194 | +1. Navigate to the administration website [https://localhost:5002/master/users](https://localhost:5002/master/users) and click on the `Add user` button. |
| 195 | + |
| 196 | +2. Fill in the fields with random information and click the `Add` button. |
| 197 | + |
| 198 | +3. Navigate to the identity provider website [https://localhost:5020](https://localhost:5020) and click on the `Application Providers` menu item. |
| 199 | + |
| 200 | +4. Open the first entity and check if the number of records migrated using the `urn:ietf:params:fastfed:1.0:provisioning:scim:2.0:enterprise` provisioning profile has increased. |
| 201 | + |
| 202 | + |
0 commit comments