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

Function pickClientAuth

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

Source from the content-addressed store, hash-verified

543// ones, so an absent secret here unambiguously means "public client". The
544// `method` only chooses HOW a present secret is sent (post vs basic).
545const pickClientAuth = (
546 clientSecret: string | null | undefined,
547 method: ClientAuthMethod,
548): oauth.ClientAuth => {
549 if (!clientSecret) return oauth.None();
550 return method === "basic"
551 ? oauth.ClientSecretBasic(clientSecret)
552 : oauth.ClientSecretPost(clientSecret);
553};
554
555const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({
556 access_token: r.access_token,

Callers 3

refreshAccessTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected