mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🔒 feat: MCP OAuth Config for Metadata Parameters (#8691)
* fix(mcp): add default metadata for pre-configured oauth * removed lingering comment * added configurable options & jest unit tests * Update handler.test.ts * Update handler.ts --------- Co-authored-by: Alex <aleksander.chernyavskiy@seafar.eu> Co-authored-by: Danny Avila <danacordially@gmail.com>
This commit is contained in:
parent
5eed5009e9
commit
056172f007
3 changed files with 213 additions and 2 deletions
|
|
@ -181,9 +181,22 @@ export class MCPOAuthHandler {
|
|||
authorization_endpoint: config.authorization_url,
|
||||
token_endpoint: config.token_url,
|
||||
issuer: serverUrl,
|
||||
scopes_supported: config.scope?.split(' '),
|
||||
scopes_supported: config.scope?.split(' ') ?? [],
|
||||
grant_types_supported: config?.grant_types_supported ?? [
|
||||
'authorization_code',
|
||||
'refresh_token',
|
||||
],
|
||||
token_endpoint_auth_methods_supported: config?.token_endpoint_auth_methods_supported ?? [
|
||||
'client_secret_basic',
|
||||
'client_secret_post',
|
||||
],
|
||||
response_types_supported: config?.response_types_supported ?? ['code'],
|
||||
code_challenge_methods_supported: config?.code_challenge_methods_supported ?? [
|
||||
'S256',
|
||||
'plain',
|
||||
],
|
||||
};
|
||||
|
||||
logger.debug(`[MCPOAuth] metadata for "${serverName}": ${JSON.stringify(metadata)}`);
|
||||
const clientInfo: OAuthClientInformation = {
|
||||
client_id: config.client_id,
|
||||
client_secret: config.client_secret,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue