start_external_auth_login
POST
/api/v1/auth/external-auth/{kind}/{provider}/start
const url = 'https://example.com/api/v1/auth/external-auth/example/example/start';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"return_path":"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/auth/external-auth/example/example/start";
let payload = json!({"return_path": "example"});
let mut headers = reqwest::header::HeaderMap::new(); 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/auth/external-auth/example/example/start \ --header 'Content-Type: application/json' \ --data '{ "return_path": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”kind
required
string
External auth provider kind
provider
required
string
External auth provider key
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
return_path
string | null
Examplegenerated
{ "return_path": "example"}Responses
Section titled “Responses”External auth authorization URL
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
Example
{ "code": "success"}Invalid request
Provider not found