OAuth-Consent genehmigen
Wird vom Nomadfiling-Frontend aufgerufen, nachdem ein Nutzer den Consent genehmigt hat, um einen kurzlebigen Authorization Code auszustellen.
curl -X POST "https://api.example.com/mcp-server/approve" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"client_id": "mcp_client_example_1234567890abcdef",
"redirect_uri": "https://client.example.app/callback",
"scope": "mcp",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
}'
import requests
import json
url = "https://api.example.com/mcp-server/approve"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"client_id": "mcp_client_example_1234567890abcdef",
"redirect_uri": "https://client.example.app/callback",
"scope": "mcp",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/mcp-server/approve", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"client_id": "mcp_client_example_1234567890abcdef",
"redirect_uri": "https://client.example.app/callback",
"scope": "mcp",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"client_id": "mcp_client_example_1234567890abcdef",
"redirect_uri": "https://client.example.app/callback",
"scope": "mcp",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
}`)
req, err := http.NewRequest("POST", "https://api.example.com/mcp-server/approve", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/mcp-server/approve')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request.body = '{
"client_id": "mcp_client_example_1234567890abcdef",
"redirect_uri": "https://client.example.app/callback",
"scope": "mcp",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256"
}'
response = http.request(request)
puts response.body
{
"code": "mcp_code_example_1234567890abcdef"
}
{
"code": 400,
"message": "Bad request"
}
{
"code": 401,
"message": "Unauthorized"
}
{
"code": 500,
"message": "Internal server error"
}
/approve
Target server for requests. Edit to use your own host.
JWT-Bearer-Token der Benutzersitzung, erforderlich für die Consent-Genehmigung im Frontend.
The media type of the request body
Registrierte OAuth-Client-Kennung.
Vom Nutzer genehmigte Redirect-URI.
Genehmigter Scope. Standard ist mcp.
PKCE-Code-Challenge-Wert, der zur Autorisierungsanfrage gehört.
PKCE-Code-Challenge-Methode.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). JWT-Bearer-Token der Benutzersitzung, erforderlich für die Consent-Genehmigung im Frontend.
Body
Registrierte OAuth-Client-Kennung.
mcp_client_example_1234567890abcdefVom Nutzer genehmigte Redirect-URI.
https://client.example.app/callbackPKCE-Code-Challenge-Wert, der zur Autorisierungsanfrage gehört.
E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cMResponses
Kurzlebiger Authorization Code mit einer Gültigkeit von 5 Minuten.