MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / pickClientAuth

Function pickClientAuth

packages/core/sdk/src/oauth-helpers.ts:446–454  ·  view source on GitHub ↗
(
  clientSecret: string | null | undefined,
  method: ClientAuthMethod,
)

Source from the content-addressed store, hash-verified

444// ones, so an absent secret here unambiguously means "public client". The
445// `method` only chooses HOW a present secret is sent (post vs basic).
446const pickClientAuth = (
447 clientSecret: string | null | undefined,
448 method: ClientAuthMethod,
449): oauth.ClientAuth => {
450 if (!clientSecret) return oauth.None();
451 return method === "basic"
452 ? oauth.ClientSecretBasic(clientSecret)
453 : oauth.ClientSecretPost(clientSecret);
454};
455
456const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({
457 access_token: r.access_token,

Callers 3

refreshAccessTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected