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

Function pickClientAuth

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

Source from the content-addressed store, hash-verified

482// ones, so an absent secret here unambiguously means "public client". The
483// `method` only chooses HOW a present secret is sent (post vs basic).
484const pickClientAuth = (
485 clientSecret: string | null | undefined,
486 method: ClientAuthMethod,
487): oauth.ClientAuth => {
488 if (!clientSecret) return oauth.None();
489 return method === "basic"
490 ? oauth.ClientSecretBasic(clientSecret)
491 : oauth.ClientSecretPost(clientSecret);
492};
493
494const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({
495 access_token: r.access_token,

Callers 3

refreshAccessTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected