You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: enterprise/all-enteprise-features/external-openid-providers.md
+59-45Lines changed: 59 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,22 @@ icon: up-right-from-square
4
4
5
5
# External OpenID providers
6
6
7
-
Defguard, [apart from being an identity provider itself](../../admin-and-features/features-and-configuration/openid-connect/), supports logging in through external OpenID providers. Currently, there are two builtin providers (Google and Microsoft) but there is also an option to specify a custom provider.
7
+
Defguard, [apart from being an identity provider itself](../../admin-and-features/features-and-configuration/openid-connect/), supports logging in through external OpenID providers. Currently, there are two built-in providers (Google and Microsoft), but there is also an option to specify a custom one.
8
8
9
9
### Prerequisites
10
10
11
-
In order to configure this feature, you will need to obtain the following values from your provider of choice:
11
+
In order to configure this feature, the following information is needed to be obtained from a provider of choice:
12
12
13
-
*`Client ID` 
14
-
*`Client Secret`
15
-
* (optional, only if you are using a custom provider) Your provider's base URL
16
-
* (optional, only if you are using Microsoft as your provider) `Tenant ID`
13
+
* Client ID
14
+
* Client secret
15
+
* (for custom provider) Your provider's base URL
16
+
* (for Microsoft as provider) Tenant ID
17
17
18
18
If you don't know where to find those values, go to the [Examples](external-openid-providers.md#examples) section, where you will find an example setup for the built-in providers.
19
19
20
20
#### Base URL
21
21
22
-
The base URL is used to discover all the necessary provider's endpoints which will be used during the authorization flow. Usually, all required information resides at `<PROVIDER_BASE_URL>/.well-known/openid-configuration`. Hence, in order for defguard to discover the endpoints, you need to provide it with only the base URL value, as the rest (well-known part) is appended automatically. The base URL value should be provided without the trailing slash, some examples:
22
+
The base URL is used to discover all the necessary provider's endpoints which will be used during the authorization flow. Usually, all required information resides at `<PROVIDER_BASE_URL>/.well-known/openid-configuration`. Hence, in order for Defguard to discover the endpoints, you need to provide it with only the base URL value, and the rest (the _well-known_ part) is appended automatically. The base URL should be provided without the trailing slash, some examples:
Everything related to the external OpenID configuration can be found in the OpenID tab of the settings page. First thing to do here would be to pick your provider using the dropdown menu under the "Provider" label. Next, fill out the required information with values acquired from your provider. If you picked "Microsoft" or "Custom", make sure to also make corresponding changes in the "Base URL" field. After you are done, click "Save changes" to keep your changes. 
38
+
Everything related to the external OpenID configuration can be found in the OpenID tab of the settings page. First thing to do here would be to pick your provider using the dropdown menu under the "Provider" label. Next, fill out the required information with values acquired from your provider. If you picked "Microsoft" or "Custom", make sure to also make corresponding changes in the "Base URL" field. After you are done, click "Save changes" to keep your changes.
39
39
40
-
You may have also noticed the checkbox option on the right. By default, when a new user (i.e. a user of whom DefGuard has no record) logs in for the first time using the external OpenID feature, their account in created automatically, based on the personal details (name, last name, email) received from the external provider. If you'd like to manually manage such users, uncheck the checkbox. Now users will need to be manually created in Defguard first in order to login. 
40
+
You may have also noticed the checkbox option on the right. By default, when a new user (i.e. a user of whom Defguard has no record) logs in for the first time using the external OpenID feature, its account is created automatically, based on the personal details (first name, last name, email) received from the external provider. If you'd like to manually manage such users, uncheck the checkbox. Now users will need to be manually created in Defguard first in order to log in.
41
41
42
42
### Examples
43
43
44
44
#### Google
45
45
46
46
[Full Google documentation](https://developers.google.com/identity/openid-connect/openid-connect)
47
47
48
-
1. The Google OpenID connect can be configured in the [Google Cloud Console](https://console.cloud.google.com)
49
-
2.If you don't have any project setup already (or you want to create a new one for this purpose), create it by clicking the dropdown menu here:
48
+
1. The Google OpenID Connect can be configured in the [Google Cloud Console](https://console.cloud.google.com)
49
+
2. If you don't have any project setup already (or you want to create a new one for this purpose), create it by clicking the dropdown menu here:
6. Fill in all required details. Make sure to fill the correct domain. This should be the top domain under which your Defguard dashboard can be accessed, not the subdomain (e.g. `defguard.example.com` -> `example.com`). 
60
+
6. Fill in all required details. Make sure to fill the correct domain. This should be the top domain under which your Defguard dashboard can be accessed, not the subdomain (e.g. `defguard.example.com` -> `example.com`).
62
61
7. On the scopes config screen, click `ADD OR REMOVE SCOPES`, Defguard requires at least the following scopes:
Make sure to select "Web application" as the application type. The other thing to note here is the redirect URI. It is the URI to which the user will be redirected from the external provider's authorization. This URI is in the form of `<DEFGUARD_DASHBOARD_URL>/auth/callback`. Replace `<DEFGUARD_DASHBOARD_URL>` with the URL under which your dashboard is accessible, e.g. `https://defguard.example.com`.
75
+
79
76
11. After you proceed further, you will be presented with a popup containing your `Client ID` and `Client Secret`, copy them and paste on the Defguard OpenID configuration page.
Make sure the Redirect URL you insert here is correct. Replace `defguard.example.com` with the domain you use for your Defguard dashboard.
101
-
6. You should be now on the registered application's management screen. You can copy the client's ID and the tenant ID from here, as you need to provide them on the Defguard settings' page.\
93
+
Make sure the Redirect URL you insert here is correct. Replace `defguard.example.com` with the domain you use for your Defguard dashboard.
102
94
95
+
6. You should be now on the registered application's management screen. You can copy the client's ID and the tenant ID from here, as you need to provide them on the Defguard settings' page.
103
96
104
97
<figure><imgsrc="../../.gitbook/assets/Zrzut ekranu 2024-10-18 o 16.13.54.png"alt=""><figcaption></figcaption></figure>
105
-
7. Go to Defguard settings, click the OpenID tab and paste the copied client ID. The tenant ID should be inserted instead of the `<TENANT_ID>` placeholder in the base URL field.
106
-
8. Now back in Microsoft Entra ID, still in your newly created application, go to Certificates and Secrets\
107
-
\
108
98
99
+
7. Go to Defguard settings, click the OpenID tab and paste the copied client ID. The tenant ID should be inserted instead of the `<TENANT_ID>` placeholder in the base URL field.
100
+
8. Now back in Microsoft Entra ID, still in your newly created application, go to **Certificates & Secrets**
14. Now you should be good to go. A new login button should appear on the login screen.
134
119
135
120
#### Custom OpenID provider
136
121
137
122
{% hint style="warning" %}
138
-
We currently only support custom providers that allow a `id_token` response type. This may change in the future.
123
+
Defguard supports custom providers that allow a **code** response typein the OpenID authorization flow.
139
124
{% endhint %}
140
125
141
126
You can also configure a custom OpenID provider. The key thing here is setting up the **Base URL** correctly. This URL is used to discover all the endpoints required for the authorization flow.
142
127
143
128
The easiest way of obtaining the Base URL is finding out what is the OpenID `.well-known` URL of your provider. For example, for Google it's `https://accounts.google.com/.well-known/openid-configuration`, in this case, the Base URL would be `https://accounts.google.com` (note the lack of a trailing slash). The part starting with `/.well-known` is added automatically, so it should be omitted from the Base URL. This is explained in more detail in the [Base URL](external-openid-providers.md#base-url) section.
144
129
145
-
In order to get the `Client ID` and `Client Secret` values, refer to the documentation of your custom provider of choice. 
130
+
In order to get the **Client ID** and **Client Secret** values, refer to the documentation of your custom provider of choice.
146
131
147
132
When configuring your external OpenID provider, at some point you will need to provide a callback URL, which will redirect the user back to Defguard. This URL is in form of `<DEFGUARD_DASHBOARD_URL>/auth/callback`. Replace `<DEFGUARD_DASHBOARD_URL>` with the URL under which your dashboard is accessible, e.g. `https://defguard.example.com`.
148
133
149
-
**Keycloak**
134
+
### Examples
135
+
136
+
#### Zitadel
137
+
138
+
Refer to [Zitadel's documentation](https://zitadel.com/docs) on how to install it.
6. Enter redirect URI for your Defguard instance. The URI is in the form `<DEFGUARD_DASHBOARD_URL>/auth/callback`, for example `https://defguard.example.com/auth/callback`. (If Defguard has been launched on the _localhost_, select **Development Mode** and enter `http://localhost:8000/auth/callback`.)
A basic guide about securing applications using Keycloack can be found [here](https://www.keycloak.org/getting-started/getting-started-docker#\_secure\_the\_first\_application). 
165
+
A basic guide about securing applications using Keycloack can be found [here](https://www.keycloak.org/getting-started/getting-started-docker#\_secure\_the\_first\_application).
0 commit comments