diff --git a/.changeset/chilled-jokes-arrive.md b/.changeset/chilled-jokes-arrive.md new file mode 100644 index 00000000000..b503a83658b --- /dev/null +++ b/.changeset/chilled-jokes-arrive.md @@ -0,0 +1,6 @@ +--- +"@wso2is/myaccount": patch +"@wso2is/console": patch +--- + +Add Functionality Enable or Disable ID Token Issuer Validation in My Account and Console diff --git a/apps/console/package.json b/apps/console/package.json index a4cde43f8cd..34fca990442 100644 --- a/apps/console/package.json +++ b/apps/console/package.json @@ -37,7 +37,7 @@ "typecheck": "pnpm run compile" }, "dependencies": { - "@asgardeo/auth-react": "^1.1.24", + "@asgardeo/auth-react": "^3.1.1", "@emotion/react": "^11.11.0", "@emotion/styled": "^11.11.0", "@microsoft/applicationinsights-core-js": "^3.0.0", diff --git a/apps/console/src/features/authentication/utils/authenticate-utils.ts b/apps/console/src/features/authentication/utils/authenticate-utils.ts index 30e10818f3b..77e646af150 100644 --- a/apps/console/src/features/authentication/utils/authenticate-utils.ts +++ b/apps/console/src/features/authentication/utils/authenticate-utils.ts @@ -60,6 +60,7 @@ export class AuthenticateUtils { authorizationEndpoint: window["AppUtils"]?.getConfig()?.idpConfigs?.authorizeEndpointURL, checkSessionIframe: window["AppUtils"]?.getConfig()?.idpConfigs?.oidcSessionIFrameEndpointURL, endSessionEndpoint: window["AppUtils"]?.getConfig()?.idpConfigs?.logoutEndpointURL, + issuer: window["AppUtils"]?.getConfig()?.idpConfigs?.issuer, jwksUri: window["AppUtils"]?.getConfig()?.idpConfigs?.jwksEndpointURL, revocationEndpoint: window["AppUtils"]?.getConfig()?.idpConfigs?.tokenRevocationEndpointURL, tokenEndpoint: window["AppUtils"]?.getConfig()?.idpConfigs?.tokenEndpointURL @@ -73,6 +74,7 @@ export class AuthenticateUtils { signInRedirectURL: window["AppUtils"]?.getConfig()?.loginCallbackURL, signOutRedirectURL: window["AppUtils"]?.getConfig()?.loginCallbackURL, storage: AuthenticateUtils.resolveStorage() as Storage.WebWorker, + validateIDTokenIssuer: window["AppUtils"]?.getConfig()?.idpConfigs?.validateIDTokenIssuer, ...window["AppUtils"]?.getConfig().idpConfigs }; }; diff --git a/apps/myaccount/package.json b/apps/myaccount/package.json index 7c3c2f07527..8014a3bfa58 100644 --- a/apps/myaccount/package.json +++ b/apps/myaccount/package.json @@ -34,7 +34,7 @@ "typecheck": "pnpm run compile" }, "dependencies": { - "@asgardeo/auth-react": "^1.1.24", + "@asgardeo/auth-react": "^3.1.1", "@babel/polyfill": "^7.0.0", "@microsoft/applicationinsights-core-js": "^3.0.0", "@microsoft/applicationinsights-react-js": "^3.4.2", diff --git a/apps/myaccount/src/utils/authenticate-util.ts b/apps/myaccount/src/utils/authenticate-util.ts index 447fcac1526..f341ac7f0aa 100644 --- a/apps/myaccount/src/utils/authenticate-util.ts +++ b/apps/myaccount/src/utils/authenticate-util.ts @@ -126,6 +126,7 @@ export const getAuthInitializeConfig = (): AuthReactConfig => { authorizationEndpoint: window["AppUtils"]?.getConfig().idpConfigs?.authorizeEndpointURL, checkSessionIframe: window["AppUtils"]?.getConfig().idpConfigs?.oidcSessionIFrameEndpointURL, endSessionEndpoint: window["AppUtils"]?.getConfig().idpConfigs?.logoutEndpointURL, + issuer: window["AppUtils"]?.getConfig()?.idpConfigs?.issuer, jwksUri: window["AppUtils"]?.getConfig().idpConfigs?.jwksEndpointURL, revocationEndpoint: window["AppUtils"]?.getConfig().idpConfigs?.tokenRevocationEndpointURL, tokenEndpoint: window["AppUtils"]?.getConfig().idpConfigs?.tokenEndpointURL @@ -138,6 +139,7 @@ export const getAuthInitializeConfig = (): AuthReactConfig => { signInRedirectURL: window["AppUtils"]?.getConfig().loginCallbackURL, signOutRedirectURL: window["AppUtils"]?.getConfig().loginCallbackURL, storage: resolveStorage() as Storage.WebWorker, + validateIDTokenIssuer: window["AppUtils"]?.getConfig()?.idpConfigs?.validateIDTokenIssuer, ...window["AppUtils"]?.getConfig().idpConfigs }; }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ad04dfec0d..26abb15c9d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -476,8 +476,8 @@ importers: apps/console: dependencies: '@asgardeo/auth-react': - specifier: ^1.1.24 - version: 1.1.24(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0) + specifier: ^3.1.1 + version: 3.1.1(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0) '@emotion/react': specifier: ^11.11.0 version: 11.11.0(@types/react@18.0.18)(react@18.2.0) @@ -825,8 +825,8 @@ importers: apps/myaccount: dependencies: '@asgardeo/auth-react': - specifier: ^1.1.24 - version: 1.1.24(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0) + specifier: ^3.1.1 + version: 3.1.1(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0) '@babel/polyfill': specifier: ^7.0.0 version: 7.12.1 @@ -2144,6 +2144,10 @@ packages: resolution: {integrity: sha512-ciMLhrm/M//CvyMpCvaoA82S3tKvB529L+MwKKBbRZFe+d0HRPuDfruDhclWl7i07XO1+AVp9Dy1MdUDkhzR4Q==} dev: false + /@asgardeo/auth-js@4.1.2: + resolution: {integrity: sha512-CYpKxQMFtxBUcp7NntlA+OoQ4BGXWLjJPYTJdMJAcU1K9GGdxGq6CvHfHGSmJ2l1qDksa8ZkCHnG/IwlDKaUqA==} + dev: false + /@asgardeo/auth-react@1.1.23(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@5.3.4)(react@18.2.0): resolution: {integrity: sha512-YzRgySd8wyfH9sRan7o8yZWpACAnSGO6kqlU+uBAtHN7kzEUDCIT3+fXGp99EVKeI8xbmu/wbhXicxS6o3jFcA==} peerDependencies: @@ -2178,15 +2182,15 @@ packages: - debug dev: false - /@asgardeo/auth-react@1.1.24(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0): - resolution: {integrity: sha512-vkQbaSAKiKflw0wTlFnbC/dKfK6UKR4IRrUm4IEydIZJAajwuikzHaqe+yHVKqFURIVq1ZCbmElrZgt9HNeiew==} + /@asgardeo/auth-react@3.1.1(@babel/runtime-corejs3@7.18.9)(react-dom@18.2.0)(react-router-dom@4.3.1)(react@18.2.0): + resolution: {integrity: sha512-JGpLaoarnBaaqBVpN8VepB2V58bonN04bCBEn3ZhYwvp5ys5xzg+L6ZlqpCtPFhaUU0rwtte7FmiCVkRaCnppA==} peerDependencies: '@babel/runtime-corejs3': ^7.11.2 react: '>=16.8' react-dom: '>=16.8' - react-router-dom: ^5.2.0 + react-router-dom: ^6.3.0 dependencies: - '@asgardeo/auth-spa': 0.4.14 + '@asgardeo/auth-spa': 2.1.1 '@babel/runtime-corejs3': 7.18.9 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -2225,6 +2229,21 @@ packages: - debug dev: false + /@asgardeo/auth-spa@2.1.1: + resolution: {integrity: sha512-24tRnOutAChqchTEGuEYQgCcDFeGqVzEtnztYRHFuX6VJ3mh6NZ/MfUm0gq5wb8oWwTNTGAhzSCcSnXZENLzgw==} + dependencies: + '@asgardeo/auth-js': 4.1.2 + await-semaphore: 0.1.3 + axios: 0.26.1 + base64url: 3.0.1 + buffer: 6.0.3 + fast-sha256: 1.3.0 + jose: 4.9.2 + randombytes: 2.1.0 + transitivePeerDependencies: + - debug + dev: false + /@babel/cli@7.18.10(@babel/core@7.18.13): resolution: {integrity: sha512-dLvWH+ZDFAkd2jPBSghrsFBuXrREvFwjpDycXbmUoeochqKYe4zNSLEJYErpLg8dvxvZYe79/MkN461XCwpnGw==} engines: {node: '>=6.9.0'}