fix introspection request headers
authorJustin Wind <justin.wind+git@gmail.com>
Tue, 27 Dec 2022 21:57:58 +0000 (13:57 -0800)
committerJustin Wind <justin.wind+git@gmail.com>
Tue, 27 Dec 2022 21:57:58 +0000 (13:57 -0800)
lib/communication.js
lib/enum.js

index d52d784690917d503e852309f4256650cfc4c60e..a9eb66100d2c2ef9525b4dc75bddb31b0769c060 100644 (file)
@@ -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`,
     });
index dcec1310229a72f00b8da3460c8d3c407c9f46db..984e19bbf541500504e407a9e25a8d5184b88ac9 100644 (file)
@@ -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