|
| 1 | +--- |
| 2 | +id: azure-entraid-as-identity-provider-iam |
| 3 | +title: Azure Entra ID as Identity Provider for IAM |
| 4 | +tags: [security, iam, azure, entraid, microsoft, openid, oidc] |
| 5 | +--- |
| 6 | + |
| 7 | +# Azure Entra ID as Identity Provider for IAM |
| 8 | + |
| 9 | +In this guide, we'll walk you through the implemention of an Identity Provider (IdP) on Open Telekom Cloud, in order to enable authentication via Azure Entra ID. This allows users managed in Entra ID to access Open Telekom Cloud resources through federated login, without requiring separate user accounts on Open Telekom Cloud. |
| 10 | + |
| 11 | +In order to achieve this: |
| 12 | + |
| 13 | +1. We need to register the necessary applications in Azure Entra ID, enabling OpenID Connect (OIDC) as the protocol for identity and token exchange with the Open Telekom Cloud environment. |
| 14 | +2. We need to use group assignments in Entra ID to control access: Entra ID groups are mapped to corresponding groups in Open Telekom Cloud, allowing fine-grained, role-based access control. |
| 15 | +3. We are **not** going to need local users in Open Telekom Cloud. Instead, virtual users (also called federated or transient users) are going to be used, derived from the identity and group claims in the OIDC tokens issued by Entra ID. |
| 16 | + |
| 17 | +This approach ensures centralized user management via Entra ID, reduces administrative overhead, and provides a secure and scalable identity integration between Azure and Open Telekom Cloud. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +Before starting with the implementation of this blueprint, make sure you have: |
| 22 | + |
| 23 | +- An Azure Subscription/Tenant. |
| 24 | +- Administrative privileges on both Azure Entra ID of your tenant and your Open Telekom Cloud IAM system. |
| 25 | +- Basic understanding of OpenID Connect concepts and flows. |
| 26 | + |
| 27 | +## Registering an Application in Entra ID |
| 28 | + |
| 29 | +### Creating a new Application |
| 30 | + |
| 31 | +1. Open [Azure Portal](https://portal.azure.com) and navigate to *Microsoft Entra ID* -> *Manage* -> *App Registrations* and click *New Registration*: |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +2. Create a new application, e.g. with **Name** `OTC-FEDERATION-OIDC`, and as **Support account types** choose **Accounts in this organization directory only**. Click *Register* to continue. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +### Configuring Redirect URIs |
| 40 | + |
| 41 | +On the pane of the new registered application click *Manage* -> *Authentication* -> *Add Redirect URI* and choose the option *Single-page Application*: |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +Add the following URLs as **Redirect URIs**: |
| 46 | + |
| 47 | +* `https://auth.otc.t-systems.com/authui/oidc/redirect` |
| 48 | +* `https://auth.otc.t-systems.com/authui/oidc/post` |
| 49 | + |
| 50 | +and enable **ID Tokens** under **Implicit grand and hybrid flows**. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +### Creating a Client Secret |
| 55 | + |
| 56 | +On the application pane navigate to *Manage* -> *Certificates & secrets* -> *Client secrets* and click *New client secret*, give it a name e.g. `OTC-FEDERATION-OIDC-CLIENT` and click *Add*. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +### Configuring Token Claims |
| 61 | + |
| 62 | +1. Navigate to *Manage* -> *Token configuration* -> *Optional claims* and click *Add optional claim*. From the given list choose an **ID** as **Token type** and select the claims **email**, **family_name**, **given_name** and click *Add*, enable **Turn on the Microsoft Graph[...]** option and click again *Add*: |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +2. Navigate to *Manage* -> *Token configuration* -> *Optional claims* and click *Add groups claim*. From the group type choose an **All groups** (it will auto-enable the consequently **Security groups** and **Directory Roles**) and then make sure that for all tokens (ID, Access, SAML) **Group ID** is selected. Click *Add* to continue: |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +### Configuring Permissions and Scopes |
| 71 | + |
| 72 | +1. Navigate to *Manage* -> *API permissions* -> *Configured permissions* and click *Add permission*. Choose **Microsoft Graph** and then **Delegated permissions**. Enable **openid** in **OpenId permissions** and click *Add*: |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +2. Navigate to *Manage* -> *Expose an API* -> *Configured permissions* and click *Add a scope*. Set **Who can consent** to **Admins and users** and **User consent display name** to `given_name` and click *Add scope*: |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +### Creating App Roles and Owners |
| 81 | + |
| 82 | +1. Navigate to *Manage* -> *App roles* and click *Create app role*. Give it a **Display name** and **Description** of your preference, set **Allowed member types** to **Both**, **Value** as `Task.Write` and click *Apply*: |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +1. Navigate to *Manage* -> *Owners* and select the users (or groups) that can administer this application. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +### Creating a new Group |
| 91 | + |
| 92 | +Navigate to *Manage* -> *Groups* -> *Overview* and click *New group*. Set **Group Type** as **Security** and fill in the rest of the information. Add **Owners** and **Members** to the group and click *Create* to continue: |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +## Configuring the Enterprise Application |
| 97 | + |
| 98 | +Open [Azure Portal](https://portal.azure.com) and navigate to *Microsoft Entra ID* -> *Manage* -> *Enterprise applications* -> *All applications* and find the application we created in the previous steps in the list: |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +1. Navigate to *Manage* -> *Properties* and and set **Visible to users** to **Yes**. Click *Save* to apply the changes: |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +2. Navigate to *Manage* -> *Users and groups* and choose the group you created in the previous step (or, though **not** recommended as can quickly become unmanageable, individual users) that will have access to this application: |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +## Configuring IAM |
| 111 | + |
| 112 | +### Creating a new Identity Provider |
| 113 | + |
| 114 | +Go to *Open Telekom Cloud Console* -> *IAM* -> *Identity Providers* and click *Create Identity Provider*: |
| 115 | + |
| 116 | +Set the following parameters and click *OK*. |
| 117 | + |
| 118 | +* **Protocol**: `OpenID Connect` |
| 119 | +* **SSO Type**: `Virtual user` |
| 120 | +* **Status**: `Enabled` |
| 121 | + |
| 122 | +### Configuring the new Identity Provider |
| 123 | + |
| 124 | +1. Open [Azure Portal](https://portal.azure.com) and navigate to *Microsoft Entra ID* -> *Manage* -> *App registrations*, find the application we created in the previous steps in the list and open it and click *Endpoints*. |
| 125 | + |
| 126 | +You need to write down the values of the following properties in **Endpoints**: |
| 127 | + |
| 128 | +* OAuth 2.0 authorization endpoint (v2) |
| 129 | +* OpenID Connect metadata document |
| 130 | + |
| 131 | +and from **Application Essentials** the value of: |
| 132 | + |
| 133 | +* Application (client) ID |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +2. Go to *Open Telekom Cloud Console* -> *IAM* -> *Identity Providers* and click *Modify* on the Identity Provider we've just created and fill in the following information: |
| 138 | + |
| 139 | +:::tip |
| 140 | +Open in a browser the URL of the **OpenID Connect metadata document** you got in the previous step as we are going to need some values for the **Identity Provider URL** and **Signing Key**. |
| 141 | +::: |
| 142 | + |
| 143 | +* **Identity Provider URL**: the value of the `issuer` in the metadata document. |
| 144 | +* **Client ID**: the value of the **Application (client) ID** |
| 145 | +* **Authorization Endpoint**: the value of the **OAuth 2.0 authorization endpoint (v2)** |
| 146 | +* **Scopes**: `openid`, `email`, `profile` |
| 147 | +* **Response Type**: `id_token` |
| 148 | +* **Response Mode**: `fragment` |
| 149 | +* **Signing Key**: access the URL given by the `jwks_uri` entry in the metadata document, and copy the **complete** response. |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +Click *OK* to apply changes and exit. |
| 154 | + |
| 155 | +### Configuring the Conversion Rules |
| 156 | + |
| 157 | +1. Open [Azure Portal](https://portal.azure.com) and navigate to *Microsoft Entra ID* -> *Manage* -> *Groups* -> *All groups* and click on the group you created on the previous steps. Note down the **Object ID** value. |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +2. Go to *Open Telekom Cloud Console* -> *IAM* -> *User Groups* and click *Create User Group*. Enter as **Name** the **Object ID** value you acquired in the previous step and click *OK*. Open the newly created group and click *Authorize* under *Permissions* to grant the permissions you wish for this group; e.g. add **ECS Admin** and later, after your first successful login, try to perform an action on a non-authorized service to this group. |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | +3. Go to *Open Telekom Cloud Console* -> *IAM* -> *Identity Providers* and click *Modify* on your Identity Provider. Under *Identity Conversion Rules* click *Edit Rule* and paste the following rule into the box. Click *Validate* and if the rule passed the validation, click *OK* twice to persist changes and exit: |
| 166 | + |
| 167 | +```json |
| 168 | +[ |
| 169 | + { |
| 170 | + "remote": [ |
| 171 | + { |
| 172 | + "type": "family_name" |
| 173 | + }, |
| 174 | + { |
| 175 | + "type": "given_name" |
| 176 | + }, |
| 177 | + { |
| 178 | + "type": "groups" |
| 179 | + } |
| 180 | + ], |
| 181 | + "local": [ |
| 182 | + { |
| 183 | + "user": { |
| 184 | + "name": "{0} {1}@entraid" |
| 185 | + } |
| 186 | + }, |
| 187 | + { |
| 188 | + "groups": "{2}" |
| 189 | + } |
| 190 | + ] |
| 191 | + } |
| 192 | +] |
| 193 | +``` |
| 194 | + |
| 195 | +4. Go to *Open Telekom Cloud Console* -> *IAM* -> *Identity Providers* and click *View* on your Identity Provider. Copy the *Login Link* under *Access Type* and access the URL from a brand new (preferrably incognito session) of your browser. |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | +If everything is configured correctly, you should be able to log in, view your details as defined in the conversion rules, and be denied access to CCE, since only our group has been granted ECS Admin privileges. |
| 200 | + |
| 201 | +:::tip |
| 202 | +You can use [OpenID Connect Debugger](https://oidcdebugger.com/) to validate and test OIDC requests and troubleshoot any failed responses. |
| 203 | +::: |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | +:::info |
| 208 | +You can find more detailed info about *Conversion Rules* under: |
| 209 | + |
| 210 | +* [Configure Identity Conversion Rules](https://docs.otc.t-systems.com/identity-access-management/umn/user_guide/identity_providers/virtual_user_sso_via_openid_connect/step_2_configure_identity_conversion_rules.html) |
| 211 | +* [Syntax of Identity Conversion Rules](https://docs.otc.t-systems.com/identity-access-management/umn/user_guide/identity_providers/syntax_of_identity_conversion_rules.html#en-us-topic-0079620340) |
| 212 | + |
| 213 | +::: |
0 commit comments