Skip to content

Commit 645ac5b

Browse files
authored
Merge pull request #5532 from JeethJJ/discovery-endpoint-wellknown
Add missing discovery endpoint info
2 parents eceaf94 + 35cbbb0 commit 645ac5b

File tree

1 file changed

+140
-20
lines changed

1 file changed

+140
-20
lines changed

en/includes/guides/authentication/oidc/discover-oidc-configs.md

Lines changed: 140 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,154 @@
1-
# Discover OpenID Connect endpoints of {{ product_name }}
1+
# Discover OpenID Connect endpoints and configurations
22

3-
When you build OpenID Connect login in your application using {{ product_name }} as your identity provider, you need to get the OpenID Connect endpoints and configurations from {{ product_name }}.
3+
When building OpenID Connect (OIDC) login in your application using {{product_name}} as your identity provider, your application needs the relevant OIDC endpoints and configurations. Your application can get these endpoints in **two main steps**:
44

5-
You can do this by invoking the discovery endpoint API or by using the {{ product_name }} Console as explained below.
5+
1. **Discover the issuer (Optional)**:
66

7-
## Prerequisite
7+
When the issuer URL of the OpenID Provider is not known in advance, your application can dynamically discover it using the **WebFinger** endpoint.
8+
9+
2. **Retrieve the OpenID Connect metadata from the issuer**:
10+
11+
Once your application discovers the issuer URL (either via WebFinger or because it’s already configured), your application can fetch the OpenID Connect metadata. This includes all the necessary endpoints (authorization, token, introspection, revocation, logout, etc.), supported scopes, response types, claims, and client authentication methods.
12+
13+
For clients or SDKs that cannot dynamically fetch these endpoints, you can get them manually from the {{product_name}} Console.
14+
15+
This guide explains how to discover the OpenID Connect endpoints of {{ product_name }} using both the API and the Console.
16+
17+
## Prerequisites
818

919
To get started, you need to have an application registered in {{ product_name }}:
1020

1121
- Register a [single-page app with OIDC]({{base_path}}/guides/applications/register-single-page-app/).
1222
- Register a [web app with OIDC]({{base_path}}/guides/applications/register-oidc-web-app/).
1323

14-
## Use the discovery endpoint
24+
## Use the API
1525

16-
OpenID Connect Discovery <!-- [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)--> allows you to discover the metadata such as endpoints, scopes, response types, claims, and supported client authentication methods of identity providers such as {{ product_name }}.
26+
This section explains how your application can dynamically discover the OpenID Connect endpoints.
1727

18-
Applications can dynamically discover the OpenID Connect identity provider metadata by calling the OpenID Connect discovery <!-- [OpenID Connect discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationRequest)--> endpoint. The structure of the request URL is as follows: `<issuer>/.well-known/openid-configuration`.
28+
### Step 1: Discover the issuer
29+
30+
OpenID Provider issuer discovery, process allows a client application to automatically find the location (issuer URL) of the OpenID Provider.
31+
32+
You can use the following endpoint to retrieve the issuer information.
1933

20-
**Issuer of {{ product_name }}**
2134
```bash
22-
{{ product_url_format }}/oauth2/token
35+
{{ product_url_format }}/.well-known/webfinger
2336
```
2437

25-
**Discovery endpoint of {{ product_name }}**
26-
```bash
27-
{{ product_url_format }}/oauth2/token/.well-known/openid-configuration
38+
The endpoint accepts the following required parameters.
39+
40+
<table>
41+
<thead>
42+
<tr class="header">
43+
<th>Parameter</th>
44+
<th>Description</th>
45+
<th>Sample Value</th>
46+
</tr>
47+
</thead>
48+
<tbody>
49+
<tr class="odd">
50+
<td><code>resource</code></td>
51+
<td>The identifier of the user whose OpenID Provider (issuer) you want to discover.</td>
52+
<td>acct:admin@localhost</td>
53+
</tr>
54+
<tr class="even">
55+
<td><code>host</code></td>
56+
<td>Specify the domain or server that hosts the WebFinger service.</td>
57+
<td>localhost:9443</td>
58+
</tr>
59+
<tr class="odd">
60+
<td><code>rel</code></td>
61+
<td>Specify the URI that identifies the type of service you want to locate.</td>
62+
<td>http://openid.net/specs/connect/1.0/issuer</td>
63+
</tr>
64+
</tbody>
65+
</table>
66+
67+
#### Sample request
68+
69+
=== "cURL"
70+
71+
```bash
72+
curl --location 'https://localhost:9443/.well-known/webfinger/openid-configuration?resource=acct:admin@localhost&rel=http://openid.net/specs/connect/1.0/issuer'
73+
```
74+
75+
=== "JavaScript - jQuery"
76+
77+
```js
78+
var settings = {
79+
"url": "{{ product_url_sample }}/.well-known/webfinger/openid-configuration",
80+
"method": "GET",
81+
"timeout": 0,
82+
"headers": { "Accept": "application/json" },
83+
"data": {
84+
"resource": "acct:admin@localhost",
85+
"rel": "http://openid.net/specs/connect/1.0/issuer"
86+
}
87+
};
88+
89+
$.ajax(settings).done(function (response) {
90+
console.log(response);
91+
});
92+
```
93+
94+
=== "Nodejs - Axios"
95+
96+
```js
97+
var axios = require('axios');
98+
99+
var config = {
100+
method: 'get',
101+
url: '{{ product_url_sample }}/.well-known/webfinger/openid-configuration',
102+
params: {
103+
resource: 'acct:admin@localhost',
104+
rel: 'http://openid.net/specs/connect/1.0/issuer'
105+
},
106+
headers: { 'Accept': 'application/json' }
107+
};
108+
109+
axios(config)
110+
.then(function (response) {
111+
console.log(JSON.stringify(response.data));
112+
})
113+
.catch(function (error) {
114+
console.log(error);
115+
});
116+
```
117+
118+
119+
#### Sample response
120+
121+
```json
122+
{
123+
"subject": "acct:admin@localhost",
124+
"links": [
125+
{
126+
"rel": "http://openid.net/specs/connect/1.0/issuer",
127+
"href": "{{ product_url_sample }}/oauth2/token"
128+
}
129+
]
130+
}
28131
```
29132

30-
**Sample request**
133+
### Step 2: Discover the issuer metadata
134+
135+
[OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) allows you to discover the metadata such as endpoints, scopes, response types, claims, and supported client authentication methods of identity providers such as {{ product_name }}.
136+
137+
Applications can dynamically discover the OpenID Connect identity provider metadata by calling the OpenID Connect discovery <!-- [OpenID Connect discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationRequest)--> endpoint. The structure of the request URL is as follows: `<issuer>/.well-known/openid-configuration`.
138+
139+
- Issuer of {{ product_name }}
140+
141+
```bash
142+
{{ product_url_format }}/oauth2/token
143+
```
144+
145+
- Discovery endpoint of {{ product_name }}
146+
147+
```bash
148+
{{ product_url_format }}/oauth2/token/.well-known/openid-configuration
149+
```
150+
151+
#### Sample request
31152

32153
=== "cURL"
33154

@@ -69,8 +190,9 @@ Applications can dynamically discover the OpenID Connect identity provider metad
69190
});
70191
```
71192

72-
**Sample response**
73-
```json
193+
#### Sample response
194+
195+
```json
74196
{
75197
"introspection_endpoint" : "{{ product_url_sample }}/oauth2/introspect",
76198
"end_session_endpoint" : "{{ product_url_sample }}/oidc/logout",
@@ -83,15 +205,13 @@ Applications can dynamically discover the OpenID Connect identity provider metad
83205
}
84206
```
85207

86-
## Get endpoints from the console
87-
88-
Some applications and SDKs are not capable of dynamically resolving endpoints from OpenID Connect discovery. For such applications, you need to configure endpoints manually.
208+
## Use the Console
89209

90-
You can get the endpoints from the console as follows:
210+
For applications and SDKs that can't dynamically resolve OpenID Connect endpoints, you can manually copy the relevant information from the Console. To do so,
91211
92212
1. On the {{ product_name }}, go to **Applications**.
93213
94-
2. Select an OIDC application from the list.
214+
2. Select your OIDC application from the list.
95215
96216
3. Go to the **Info** tab of the application and find the server endpoints to your organization.
97217

0 commit comments

Comments
 (0)