diff --git a/package.json b/package.json index c02ce03..73d31b8 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepare": "npm run build" }, "dependencies": { - "@tribufu/mintaka": "0.1.2", + "@tribufu/mintaka": "0.1.3", "axios": "^1.6.3", "camelcase-keys": "^9.1.2", "fp-ts": "^2.16.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04484ff..01b012c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@tribufu/mintaka': - specifier: 0.1.2 - version: 0.1.2 + specifier: 0.1.3 + version: 0.1.3 axios: specifier: ^1.6.3 version: 1.6.4 @@ -290,8 +290,8 @@ packages: dev: true optional: true - /@tribufu/mintaka@0.1.2: - resolution: {integrity: sha512-S6bEYchoI/Y2K803DMUW75kW3FycQCrJO2P4e+S8w1G/7gXRm+d2cvUplZLgtGVC2/X7NYrWRs5Yw6CWmjPDGQ==} + /@tribufu/mintaka@0.1.3: + resolution: {integrity: sha512-MMv0saUpDt4MxUW5cD7y9UlOvF10Qv010dgzOkMxrh2/FmCg/KjfVviPGQLRp54IHZQWTSMdGPHX/4x/G/5CZQ==} dependencies: axios: 1.6.4 camelcase-keys: 9.1.2 diff --git a/src/client.ts b/src/client.ts index 5ad0a3e..3d076a4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -103,7 +103,7 @@ export class TribufuClient extends TribufuApi { * @param tokens */ private setTokensFromResponse(tokens: OAuth2TokenResponse): void { - this.setTokens(tokens.accessToken, tokens.refreshToken || null, tokens.expiresIn || null); + this.setTokens(tokens.access_token, tokens.refresh_token || null, tokens.expires_in || null); } /** @@ -245,7 +245,7 @@ export class TribufuClient extends TribufuApi { const requestBody: OAuth2IntrospectionRequest = { token: this.options.accessToken, - tokenTypeHint: "access_token", + token_type_hint: "access_token", } const url = `/v1/oauth2/introspect`; @@ -270,7 +270,7 @@ export class TribufuClient extends TribufuApi { const requestBody: OAuth2IntrospectionRequest = { token: this.options.refreshToken, - tokenTypeHint: "refresh_token", + token_type_hint: "refresh_token", } const url = `/v1/oauth2/revoke`; @@ -310,14 +310,14 @@ export class TribufuClient extends TribufuApi { */ protected async getToken(grantType: OAuth2GrantType, grantValue: string | null, subjectKey: string | null, subjectValue: string | null): Promise { const requestBody: OAuth2TokenRequest = { - grantType: grantType, + grant_type: grantType, code: grantType === "authorization_code" ? grantValue : null, - refreshToken: grantType === "refresh_token" ? grantValue : null, + refresh_token: grantType === "refresh_token" ? grantValue : null, username: grantType === "password" || grantType === "passkey" ? subjectValue : null, password: grantType === "password" ? grantValue : null, passkey: grantType === "passkey" ? grantValue : null, - clientId: this.clientId, - clientSecret: this.clientSecret, + client_id: this.clientId, + client_secret: this.clientSecret, } const params = subjectKey && subjectValue ? `?${subjectKey}=${subjectValue}` : "";