获取 OpenID 配置
curl --request GET \
--url https://{issuer}/.well-known/openid-configurationimport requests
url = "https://{issuer}/.well-known/openid-configuration"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{issuer}/.well-known/openid-configuration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{issuer}/.well-known/openid-configuration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{issuer}/.well-known/openid-configuration"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{issuer}/.well-known/openid-configuration")
.asString();require 'uri'
require 'net/http'
url = URI("https://{issuer}/.well-known/openid-configuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"issuer": "https://your-app.auth.didit.me",
"authorization_endpoint": "https://your-app.auth.didit.me/sign-in",
"token_endpoint": "https://your-app.auth.didit.me/token/",
"jwks_uri": "https://your-app.auth.didit.me/.well-known/jwks.json",
"response_types_supported": [
"code"
],
"response_modes_supported": [
"query"
],
"grant_types_supported": [
"authorization_code",
"refresh_token"
],
"subject_types_supported": [
"public"
],
"id_token_signing_alg_values_supported": [
"ES256"
],
"token_endpoint_auth_methods_supported": [
"none"
],
"code_challenge_methods_supported": [
"S256"
],
"scopes_supported": [
"openid",
"email",
"phone",
"profile",
"offline_access"
],
"claims_supported": [
"iss",
"aud",
"sub",
"sid",
"auth_time",
"nonce",
"vendor_data",
"amr",
"org",
"verified",
"act",
"email",
"email_verified",
"name",
"phone_number"
]
}API 参考
获取 OpenID 配置(发现文档)| Didit Authentication API
Didit 的 GET /.well-known/openid-configuration 接口返回您应用的 OpenID Connect 发现文档:issuer、endpoint、授权类型、ES256 和声明。
GET
/
.well-known
/
openid-configuration
获取 OpenID 配置
curl --request GET \
--url https://{issuer}/.well-known/openid-configurationimport requests
url = "https://{issuer}/.well-known/openid-configuration"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{issuer}/.well-known/openid-configuration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{issuer}/.well-known/openid-configuration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{issuer}/.well-known/openid-configuration"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{issuer}/.well-known/openid-configuration")
.asString();require 'uri'
require 'net/http'
url = URI("https://{issuer}/.well-known/openid-configuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"issuer": "https://your-app.auth.didit.me",
"authorization_endpoint": "https://your-app.auth.didit.me/sign-in",
"token_endpoint": "https://your-app.auth.didit.me/token/",
"jwks_uri": "https://your-app.auth.didit.me/.well-known/jwks.json",
"response_types_supported": [
"code"
],
"response_modes_supported": [
"query"
],
"grant_types_supported": [
"authorization_code",
"refresh_token"
],
"subject_types_supported": [
"public"
],
"id_token_signing_alg_values_supported": [
"ES256"
],
"token_endpoint_auth_methods_supported": [
"none"
],
"code_challenge_methods_supported": [
"S256"
],
"scopes_supported": [
"openid",
"email",
"phone",
"profile",
"offline_access"
],
"claims_supported": [
"iss",
"aud",
"sub",
"sid",
"auth_time",
"nonce",
"vendor_data",
"amr",
"org",
"verified",
"act",
"email",
"email_verified",
"name",
"phone_number"
]
}身份验证功能是新推出的。这些端点由您应用的签发方提供,例如
https://<name>.auth.didit.me,并且绝不接受您的 Didit API 密钥。响应
发现文档。
签发方的 OpenID Connect 发现文档。请从此文档读取各 endpoint,而不是自行拼装。
签发方:应用的登录源(origin),末尾不带斜杠。每个 token 的 iss 都与此相同。
示例:
"https://your-app.auth.didit.me"
托管登录页面(/sign-in)。
示例:
"https://your-app.auth.didit.me/sign-in"
示例:
"https://your-app.auth.didit.me/token/"
示例:
"https://your-app.auth.didit.me/.well-known/jwks.json"
示例:
["code"]
示例:
["query"]
示例:
["authorization_code", "refresh_token"]
示例:
["public"]
示例:
["ES256"]
none:客户端是公开的,不发送任何秘密信息。
示例:
["none"]
示例:
["S256"]
示例:
[
"openid",
"email",
"phone",
"profile",
"offline_access"
]
示例:
[
"iss",
"aud",
"sub",
"sid",
"auth_time",
"nonce",
"vendor_data",
"amr",
"org",
"verified",
"act",
"email",
"email_verified",
"name",
"phone_number"
]
最后修改于 2026年11月7日