summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/http-client/authentication.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/http-client/authentication.ts')
-rw-r--r--packages/taler-util/src/http-client/authentication.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/taler-util/src/http-client/authentication.ts b/packages/taler-util/src/http-client/authentication.ts
index 00ef21a06..f77df2ed0 100644
--- a/packages/taler-util/src/http-client/authentication.ts
+++ b/packages/taler-util/src/http-client/authentication.ts
@@ -45,7 +45,6 @@ export class TalerAuthenticationHttpClient {
constructor(
readonly baseUrl: string,
- readonly username: string,
httpClient?: HttpRequestLibrary,
) {
this.httpLib = httpClient ?? createPlatformHttpLib();
@@ -61,7 +60,8 @@ export class TalerAuthenticationHttpClient {
*
* @returns
*/
- async createAccessToken(
+ async createAccessTokenBasic(
+ username: string,
password: string,
body: TalerAuthentication.TokenRequest,
) {
@@ -69,7 +69,7 @@ export class TalerAuthenticationHttpClient {
const resp = await this.httpLib.fetch(url.href, {
method: "POST",
headers: {
- Authorization: makeBasicAuthHeader(this.username, password),
+ Authorization: makeBasicAuthHeader(username, password),
},
body,
});
@@ -90,15 +90,15 @@ export class TalerAuthenticationHttpClient {
*
* @returns
*/
- async createAccessTokenMerchant(
- password: string,
+ async createAccessTokenBearer(
+ token: string,
body: TalerAuthentication.TokenRequest,
) {
const url = new URL(`token`, this.baseUrl);
const resp = await this.httpLib.fetch(url.href, {
method: "POST",
headers: {
- Authorization: makeBearerTokenAuthHeader(password as AccessToken),
+ Authorization: makeBearerTokenAuthHeader(token as AccessToken),
},
body,
});