* Applies HTTP Basic authentication (RFC 6749 Section 2.3.1)
(clientId: string, clientSecret: string | undefined, headers: Headers)
| 340 | * Applies HTTP Basic authentication (RFC 6749 Section 2.3.1) |
| 341 | */ |
| 342 | function applyBasicAuth(clientId: string, clientSecret: string | undefined, headers: Headers): void { |
| 343 | if (!clientSecret) { |
| 344 | throw new Error('client_secret_basic authentication requires a client_secret'); |
| 345 | } |
| 346 | |
| 347 | const credentials = btoa(`${clientId}:${clientSecret}`); |
| 348 | headers.set('Authorization', `Basic ${credentials}`); |
| 349 | } |
| 350 | |
| 351 | /** |
| 352 | * Applies POST body authentication (RFC 6749 Section 2.3.1) |
no outgoing calls
no test coverage detected
searching dependent graphs…