use wacht::models::{CreateOAuthAppRequest, CreateOAuthClientRequest};
let app = client.oauth()
.create_oauth_app(
"dep_123",
CreateOAuthAppRequest {
slug: "mcp-auth".to_string(),
name: "MCP Auth App".to_string(),
description: Some("OAuth provider for MCP access".to_string()),
fqdn: Some("auth.example.com".to_string()),
supported_scopes: Some(vec!["mcp:invoke".to_string(), "workspace:read".to_string()]),
scope_definitions: None,
allow_dynamic_client_registration: Some(false),
logo_file: None,
logo_filename: None,
},
)
.send()
.await?;
let oauth_client = client.oauth()
.create_oauth_client(
"dep_123",
"mcp-auth",
CreateOAuthClientRequest {
client_auth_method: "client_secret_basic".to_string(),
grant_types: vec!["authorization_code".to_string(), "refresh_token".to_string()],
redirect_uris: vec!["https://app.example.com/oauth/callback".to_string()],
token_endpoint_auth_signing_alg: None,
jwks_uri: None,
jwks: None,
public_key_pem: None,
},
)
.send()
.await?;