ef-keycloak-connect 1.8.4-patch-3.0 → 1.8.4-patch-4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ef-keycloak-connect",
3
- "version": "1.8.4-patch-3.0",
3
+ "version": "1.8.4-patch-4.0",
4
4
  "description": "Node JS keycloak adapter for authentication and authorization.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -62,7 +62,7 @@ class KeycloakService extends Keycloak {
62
62
  if ( !attributesFromToken || !attributesFromToken.is2FARegistered || attributesFromToken.is2FARegistered == 'false' ) {
63
63
 
64
64
  // getting admin access token to update the user attributes for RSA & Auht Apps
65
- const adminData = await this.getAccessToken( keycloakConfig.USERNAME_ADMIN, keycloakConfig.PASSWORD_ADMIN );
65
+ const adminData = await this.getAccessToken( this.keycloakConfig.USERNAME_ADMIN, this.keycloakConfig.PASSWORD_ADMIN );
66
66
  const adminToken = adminData.access_token;
67
67
 
68
68
  // appending extra information regarding 2FA in response object
@@ -239,7 +239,7 @@ class KeycloakService extends Keycloak {
239
239
 
240
240
  return new Promise( async ( resolve, reject ) => {
241
241
 
242
- let URL = keycloakConfig[ "auth-server-url" ] + "realms/" + keycloakConfig[ "realm" ] + "/protocol/openid-connect/token/introspect";
242
+ let URL = this.keycloakConfig[ "auth-server-url" ] + "realms/" + this.keycloakConfig[ "realm" ] + "/protocol/openid-connect/token/introspect";
243
243
 
244
244
  let config = {
245
245
  method: "post",
@@ -507,7 +507,7 @@ class KeycloakService extends Keycloak {
507
507
  // running OTP validation flow for RSA Authenticator
508
508
  else if ( userAttributes.twoFAChannel[ 0 ] === 'rsa' ) {
509
509
  // setting up SecurID API for MFA
510
- let URL = keycloakConfig.RSA_Server_URL + "mfa/v1_1/authn/initialize";
510
+ let URL = this.keycloakConfig.RSA_Server_URL + "mfa/v1_1/authn/initialize";
511
511
 
512
512
  // configuring headers & payload
513
513
  let config = {
@@ -761,7 +761,7 @@ class KeycloakService extends Keycloak {
761
761
  let rpt_token = rptResponse.data.access_token;
762
762
 
763
763
  let userToken = token;
764
- config.data.grant_type = keycloakConfig.GRANT_TYPE;
764
+ config.data.grant_type = this.keycloakConfig.GRANT_TYPE;
765
765
  config.data.token = rpt_token;
766
766
  URL = URL + "/introspect";
767
767
  config.url = URL;
@@ -773,7 +773,7 @@ class KeycloakService extends Keycloak {
773
773
  intrsopectionResponse.data.access_token = rpt_token;
774
774
 
775
775
  responseObject.permittedResources = {
776
- Resources: ( intrsopectionResponse.data.authorization.permissions.length > 0 ) ? intrsopectionResponse.data.authorization.permissions : []
776
+ Resources: ( intrsopectionResponse?.data?.authorization?.permissions?.length > 0 ) ? intrsopectionResponse?.data?.authorization?.permissions : []
777
777
  }
778
778
 
779
779
  // T.O.K.E.N R.E.Q.U.E.S.T # 4 ( A.D.M.I.N. T.O.K.E.N)