From 91ccbf258b9f21a3c82f714c5fbb965644279bf4 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Tue, 27 Dec 2022 13:57:58 -0800 Subject: [PATCH] fix introspection request headers --- lib/communication.js | 6 +++--- lib/enum.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/communication.js b/lib/communication.js index d52d784..a9eb661 100644 --- a/lib/communication.js +++ b/lib/communication.js @@ -792,15 +792,15 @@ class Communication { /** * Verify a token with an IdP endpoint, using the Authentication header supplied. * @param {URL} introspectionUrlObj - * @param {String} authenticationHeader + * @param {String} authorizationHeader * @param {String} token */ - async introspectToken(introspectionUrlObj, authenticationHeader, token) { + async introspectToken(introspectionUrlObj, authorizationHeader, token) { const _scope = _fileScope('introspectToken'); const formData = common.formData({ token }); const postIntrospectConfig = Communication._axiosConfig('POST', introspectionUrlObj, formData, {}, { - [Enum.Header.Authentication]: authenticationHeader, + [Enum.Header.Authorization]: authorizationHeader, [Enum.Header.ContentType]: Enum.ContentType.ApplicationForm, [Enum.Header.Accept]: `${Enum.ContentType.ApplicationJson}, ${Enum.ContentType.Any};q=0.1`, }); diff --git a/lib/enum.js b/lib/enum.js index dcec131..984e19b 100644 --- a/lib/enum.js +++ b/lib/enum.js @@ -12,8 +12,10 @@ module.exports = { Header: { Accept: 'Accept', + Authorization: 'Authorization', ContentType: 'Content-Type', Link: 'Link', UserAgent: 'User-Agent', + WWWAuthenticate: 'WWW-Authenticate', }, }; \ No newline at end of file -- 2.45.2