Socket
Socket
Sign inDemoInstall

@pega/auth

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pega/auth - npm Package Compare versions

Comparing version 0.2.13 to 0.2.14

25

lib/oauth-client/auth.js

@@ -206,10 +206,6 @@ export class PegaAuth {

let bDisablePromptNone = false;
// Onload handlers fire for iframe content (but not for popup windows)
const myWinOnLoad = () => {
try {
if (bWinIframe) {
elIframe.contentWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
}
else {
myWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
}
elIframe.contentWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
}

@@ -241,13 +237,6 @@ catch (e) {

}
// Post to the popup window to cover scenario where window.opener is disabled on
// popup window by some security library (like helmet.js)
myWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
}, 500);
if (!this.isNode) {
try {
myWindow.addEventListener('load', myWinOnLoad, true);
}
catch (e) {
// Exception trying to add onload handler to opened window
// eslint-disable-next-line no-console
console.error(`Error adding event listener on popup window: ${e}`);
}
}
};

@@ -534,4 +523,4 @@ /* eslint-enable prefer-promise-reject-errors */

// eslint-disable-next-line no-restricted-globals
const state = btoa(location.origin);
this.#buildAuthorizeUrl(state).then(url => {
const startState = btoa(location.origin);
this.#buildAuthorizeUrl(startState).then(url => {
// eslint-disable-next-line no-restricted-globals

@@ -538,0 +527,0 @@ location.href = url;

@@ -166,3 +166,3 @@ // This file wraps various calls related to logging in, logging out, etc.

}
// Setter for clientId
// Setter for keySuffix
set keySuffix(s) {

@@ -854,3 +854,8 @@ this.state.sfx = s || undefined;

console.error(`Authorization code grant flow error (${error}): ${errorDesc}`);
return;
if (error === 'invalid_session_index') {
this.clear();
}
else {
return;
}
}

@@ -861,3 +866,3 @@ if (window.location.href.includes('?code')) {

const cbDefault = () => {
window.location.href = window.location.pathname;
window.location.replace(window.location.pathname);
};

@@ -864,0 +869,0 @@ // eslint-disable-next-line no-console

{
"name": "@pega/auth",
"version": "0.2.13",
"version": "0.2.14",
"description": "Pega OAuth 2.0 Client Library (supports Infinity and Launchpad).",

@@ -5,0 +5,0 @@ "repository": {

@@ -9,3 +9,3 @@ # Pega Auth

The oauth-client library is the default library and is available by a simple import of '@pega/auth'. It implements simple OAuth client library for browser or Node cli clients to leverage OAuth services provided by Pega Infinity and Pega Launchpad. The methods facilitate the implementation of supported client-side initiated grant flows to the Pega Server. Presently it supports the following grant types: authorization code (with or without PKCE), client credentials, password credentials and custom bearer.
The oauth-client library is the default library and is available by a simple import of '@pega/auth'. It implements a simple OAuth client library for browser or Node cli clients to leverage OAuth services provided by Pega Infinity and Pega Launchpad. The methods facilitate the implementation of supported client-side initiated grant flows to the Pega Server. Presently it supports the following grant types: authorization code (with or without PKCE), client credentials, password credentials and custom bearer.

@@ -44,4 +44,7 @@ The library contains a single JS Class named PegaAuth, which facilitates the acquisition and management of OAuth tokens for a Web or Node client.

| clientSecret | string | | OAuth 2.0 client secret (only for confidential OAuth 2.0 client registrations) |
| authorizeUri | string | | URI to OAuth 2.0 authorize endpoint (only relevant for 'authCode' grant type) |
| tokenUri | string | | OAuth 2.0 token URI |
| userinfoUri | string | | OAuth 2.0 userinfo URI |
| revokeUri | string | | OAuth 2.0 revoke URI |
| redirectUri | string | | OAuth 2.0 redirect URI (only relevant for 'authCode' grant type) |
| authorizeUri | string | | URI to OAuth 2.0 authorize endpoint (only relevant for 'authCode' grant type) |
| authService | string | | Infinity Authentication service alias (only relevant for 'authCode' grant type) |

@@ -54,3 +57,2 @@ | appAlias | string | | Application alias for pega app being accessed. If not specified will utilize the default access group within the current user's operator record |

| iframeLoginUI | boolean | false | Set to _true_ to make a failed silent authentication iframe visible, rather than opening a popup window when silent authentication fails or times out (only relevant for 'authCode' grant type) |
| tokenUri | string | | OAuth 2.0 token URI |
| customTokenParams | string | | JSON structure with params to pass as part of customBearer grant flow |

@@ -57,0 +59,0 @@ | noPopups | boolean | false | Set to _true_ to disable any popup window attempts (only relevant for 'authCode' grant type) |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc