admin_test_external_auth_provider_params
POST
/api/v1/admin/external-auth/providers/test
const url = 'https://example.com/api/v1/admin/external-auth/providers/test';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"authorization_url":"example","client_id":"example","client_secret":"example","issuer_url":"example","options":{"microsoft":{"tenant":"example"}},"provider_kind":"oidc","scopes":"example","token_url":"example","userinfo_url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/admin/external-auth/providers/test";
let payload = json!({ "authorization_url": "example", "client_id": "example", "client_secret": "example", "issuer_url": "example", "options": json!({"microsoft": json!({"tenant": "example"})}), "provider_kind": "oidc", "scopes": "example", "token_url": "example", "userinfo_url": "example" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://example.com/api/v1/admin/external-auth/providers/test \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "authorization_url": "example", "client_id": "example", "client_secret": "example", "issuer_url": "example", "options": { "microsoft": { "tenant": "example" } }, "provider_kind": "oidc", "scopes": "example", "token_url": "example", "userinfo_url": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
authorization_url
string | null
client_id
required
string
client_secret
string | null
issuer_url
string | null
options
provider_kind
required
Built-in external authentication provider kinds.
string
scopes
string | null
token_url
string | null
userinfo_url
string | null
Responses
Section titled “Responses”External auth provider parameters tested
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
code
required
string
data
Provider health/test result returned to admin tooling.
object
authorization_endpoint
Effective authorization endpoint, when applicable.
string | null
checks
required
Individual test checks.
Array<object>
Single provider health/test check.
object
message
required
Human-readable check result.
string
name
required
Machine-readable check name.
string
success
required
Whether the check passed.
boolean
issuer
Effective issuer URL, when applicable.
string | null
jwks_key_count
Number of discovered JWKS keys, when applicable.
integer | null
provider
required
Display name of the tested provider driver.
string
token_endpoint
Effective token endpoint, when applicable.
string | null
userinfo_endpoint
Effective userinfo endpoint, when applicable.
string | null
error
msg
required
string
Example
{ "code": "success"}Discovery failed
Unauthorized
Forbidden