@modelcontextprotocol/sdk
Preparing search index...
client/auth
exchangeAuthorization
Function exchangeAuthorization
exchangeAuthorization
(
authorizationServerUrl
:
string
|
URL
,
__namedParameters
:
{
authorizationCode
:
string
;
clientInformation
:
{
client_id
:
string
;
client_id_issued_at
?:
number
;
client_secret
?:
string
;
client_secret_expires_at
?:
number
;
}
;
codeVerifier
:
string
;
metadata
?:
objectOutputType
<
{
authorization_endpoint
:
ZodString
;
code_challenge_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
grant_types_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
introspection_endpoint
:
ZodOptional
<
ZodString
>
;
introspection_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
introspection_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
issuer
:
ZodString
;
registration_endpoint
:
ZodOptional
<
ZodString
>
;
response_modes_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
response_types_supported
:
ZodArray
<
ZodString
,
"many"
>
;
revocation_endpoint
:
ZodOptional
<
ZodString
>
;
revocation_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
revocation_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
scopes_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
service_documentation
:
ZodOptional
<
ZodString
>
;
token_endpoint
:
ZodString
;
token_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
token_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
}
,
ZodTypeAny
,
"passthrough"
,
>
;
redirectUri
:
string
|
URL
;
}
,
)
:
Promise
<
{
access_token
:
string
;
expires_in
?:
number
;
refresh_token
?:
string
;
scope
?:
string
;
token_type
:
string
;
}
,
>
Exchanges an authorization code for an access token with the given server.
Parameters
authorizationServerUrl
:
string
|
URL
__namedParameters
:
{
authorizationCode
:
string
;
clientInformation
:
{
client_id
:
string
;
client_id_issued_at
?:
number
;
client_secret
?:
string
;
client_secret_expires_at
?:
number
;
}
;
codeVerifier
:
string
;
metadata
?:
objectOutputType
<
{
authorization_endpoint
:
ZodString
;
code_challenge_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
grant_types_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
introspection_endpoint
:
ZodOptional
<
ZodString
>
;
introspection_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
introspection_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
issuer
:
ZodString
;
registration_endpoint
:
ZodOptional
<
ZodString
>
;
response_modes_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
response_types_supported
:
ZodArray
<
ZodString
,
"many"
>
;
revocation_endpoint
:
ZodOptional
<
ZodString
>
;
revocation_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
revocation_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
scopes_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
>
;
service_documentation
:
ZodOptional
<
ZodString
>
;
token_endpoint
:
ZodString
;
token_endpoint_auth_methods_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
token_endpoint_auth_signing_alg_values_supported
:
ZodOptional
<
ZodArray
<
ZodString
,
"many"
>
,
>
;
}
,
ZodTypeAny
,
"passthrough"
,
>
;
redirectUri
:
string
|
URL
;
}
Returns
Promise
<
{
access_token
:
string
;
expires_in
?:
number
;
refresh_token
?:
string
;
scope
?:
string
;
token_type
:
string
;
}
,
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
@modelcontextprotocol/sdk
Loading...
Exchanges an authorization code for an access token with the given server.