|
| 1 | +# KeyCloak federation with Active Directory |
| 2 | + |
| 3 | +## Deploy KeyCloak |
| 4 | + |
| 5 | +You can deploy KeyCloak by installing one of the Adaptive Apps capability portfolios. Once an Adaptive App capability profile is deployed, you can acess KeyCloak portal locally by: |
| 6 | + |
| 7 | +1. Port forward to KeyCloak portal |
| 8 | + |
| 9 | + ```bash |
| 10 | + kubectl port-forward -n compute-core svc/compute-core-keycloak 8080:8080 |
| 11 | + ``` |
| 12 | + |
| 13 | +2. Open `http://localhost:8080` and sign in with the chart values: |
| 14 | + |
| 15 | + - username: `admin` |
| 16 | + - password: `admin` |
| 17 | + |
| 18 | + Then, you can use KeyCloak portal to manage users and credentials. |
| 19 | + |
| 20 | +## Setting up Active Directory Domain Services (ADDS) on a VM |
| 21 | + |
| 22 | +See instructions [here](./adds-vm.md). |
| 23 | + |
| 24 | +## Configuring user federation |
| 25 | + |
| 26 | +1. Login to KeyCloak portal |
| 27 | +2. Select **User fedreation**, then **Add Ldap providers** |
| 28 | +3. Enter these values: |
| 29 | + |
| 30 | + * **Connection URL**: ldaps://`<domain controller host name>`:636 |
| 31 | + |
| 32 | + > **NOTE**: The host name needs to be consistent with certificate subject name |
| 33 | + |
| 34 | + * **Enable StartTLS** : Off |
| 35 | + * **Use Truststore SPI**: Always |
| 36 | + * **Connection pooling**: On |
| 37 | + |
| 38 | +4. Use "Test Connection" button to verify connection. |
| 39 | +5. Enter these bind values: |
| 40 | + |
| 41 | + * **Bind type**: simple |
| 42 | + * **Bind DN**: CN=Administrator,CN=Users,DC=corp,DC=local |
| 43 | + * **Bind credentials**: `<Administrator password>` |
| 44 | +6. In "LDAP searching and updating" section: |
| 45 | + |
| 46 | + * **Edit mode**: READ_ONLY |
| 47 | + * **Users DN**: CN=Users,DC=corp,DC=local |
| 48 | + * **Username LDAP attribute**: sAMAccountName |
| 49 | + * **RDN LDAP attribute**: cn |
| 50 | + * **UUID LDAP attribute**: objectGUID |
| 51 | + * **User object classes**: person, organizationalPerson, user |
| 52 | + * **Search scope**: One Level |
| 53 | +7. Click "Save" |
| 54 | +8. At the top of the screen, select "Action"->"Sync all users" to test. You should see users added/updated message. |
| 55 | +9. In KeyCloak portal, click on "Clients" in the left panel. |
| 56 | +10. Click on "Create client" button. |
| 57 | +11. Enter a client id and click "Next". |
| 58 | +12. Set "Client authentication" to On. |
| 59 | +13. Set "Valid redriect URIs" to "http://localhost:3000/*" (this is the app frontend URL). |
| 60 | +14. Click "Save". |
| 61 | +15. Go to "Credentails", copy "Client Secret". You'll need to supply this to your app Radius deployment. |
0 commit comments