Skip to content

Update nx #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rude-sloths-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@forgerock/javascript-sdk': minor
---

Add new PingOne signoff, remove unneeded /session call, add flag for iframe
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ packages/javascript-sdk/lib/
.env.serve.development

# Certificates
# *.pem
*.pem

# IDEs
.vscode
Expand Down Expand Up @@ -83,4 +83,4 @@ outputs/*

e2e/mock-api-v2/html/*

vitest.config.*.timestamp*
vitest.config.*.timestamp*
6 changes: 5 additions & 1 deletion e2e/autoscript-apps/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["**/*"]
"ignorePatterns": [
"**/*",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
]
}
11 changes: 4 additions & 7 deletions e2e/autoscript-apps/src/authn-central-logout/autoscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ async function autoscript() {

const logout = async () => {
try {
await forgerock.FRUser.logout({
logoutRedirectUri: `${window.location.origin}${window.location.pathname}`,
});
await forgerock.FRUser.logout();
} catch (error) {
console.error(error);
}
Expand All @@ -67,7 +65,7 @@ async function autoscript() {
* Passing no arguments or a key-value of `login: 'embedded'` means
* the app handles authentication locally.
*/
await forgerock.TokenManager.getTokens({ login: 'redirect' });
await forgerock.TokenManager.getTokens({ login: 'redirect', skipBackgroundRequest: true });
const user = await forgerock.UserManager.getCurrentUser();
showUser(user);
});
Expand All @@ -80,10 +78,9 @@ async function autoscript() {
await forgerock.Config.setAsync({
clientId: '724ec718-c41c-4d51-98b0-84a583f450f9', // e.g. 'ForgeRockSDKClient'
redirectUri: `${window.location.origin}${window.location.pathname}`, // Redirect back to your app, e.g. 'https://sdkapp.example.com:8443'
scope: 'openid profile email name revoke', // e.g. 'openid profile email address phone me.read'
scope: 'openid profile email revoke', // e.g. 'openid profile email address phone me.read'
serverConfig: {
wellknown:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
wellknown: 'https://pingone.petrov.ca/as/.well-known/openid-configuration',
},
realmPath: '', // e.g. 'alpha' or 'root'
});
Expand Down
8 changes: 7 additions & 1 deletion e2e/mock-api-v2/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "README.md", ".DS_Store"],
"ignorePatterns": [
"!**/*",
"README.md",
".DS_Store",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
7 changes: 6 additions & 1 deletion e2e/token-vault-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "public"],
"ignorePatterns": [
"!**/*",
"public",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
6 changes: 5 additions & 1 deletion e2e/token-vault-interceptor/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": [
"!**/*",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
6 changes: 5 additions & 1 deletion e2e/token-vault-proxy/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": [
"!**/*",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@
"@effect/platform-node": "^0.53.26",
"@effect/schema": "^0.68.23",
"@effect/vitest": "^0.6.7",
"@nx/devkit": "20.3.3",
"@nx/esbuild": "20.3.3",
"@nx/eslint": "20.3.3",
"@nx/eslint-plugin": "20.3.3",
"@nx/express": "20.3.3",
"@nx/js": "20.3.3",
"@nx/node": "20.3.3",
"@nx/playwright": "20.3.3",
"@nx/vite": "20.3.3",
"@nx/web": "20.3.3",
"@nx/workspace": "20.3.3",
"@nx/devkit": "20.7.2",
"@nx/esbuild": "20.7.2",
"@nx/eslint": "20.7.2",
"@nx/eslint-plugin": "20.7.2",
"@nx/express": "20.7.2",
"@nx/js": "20.7.2",
"@nx/node": "20.7.2",
"@nx/playwright": "20.7.2",
"@nx/vite": "20.7.2",
"@nx/web": "20.7.2",
"@nx/workspace": "20.7.2",
"@playwright/test": "^1.47.2",
"@swc-node/register": "1.9.2",
"@swc/core": "1.5.7",
"@swc/helpers": "0.5.12",
"@types/estree": "^1.0.1",
"@types/express": "4.17.17",
"@types/express": "4.17.21",
"@types/node": "22.10.2",
"@typescript-eslint/eslint-plugin": "7.16.1",
"@typescript-eslint/parser": "7.16.1",
Expand All @@ -80,19 +80,20 @@
"effect-http-node": "^0.16.1",
"esbuild": "^0.19.2",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-prettier": "10.1.2",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-playwright": "^1.5.1",
"eslint-plugin-prettier": "^5.1.3",
"express": "^4.21.0",
"express": "4.21.2",
"fast-check": "^3.19.0",
"husky": "^8.0.3",
"jiti": "2.4.2",
"jsdom": "22.1.0",
"jsonc-eslint-parser": "^2.1.0",
"lint-staged": "^13.2.2",
"mkcert": "^3.2.0",
"npm-cli-login": "^1.0.0",
"nx": "20.3.3",
"nx": "20.7.2",
"playwright": "^1.47.2",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
Expand All @@ -105,11 +106,11 @@
"typedoc": "^0.27.4",
"typedoc-github-theme": "0.2.0",
"typedoc-plugin-rename-defaults": "^0.7.2",
"typescript": "5.6.3",
"typescript": "5.7.3",
"uuid": "^9.0.1",
"verdaccio": "^5.29.2",
"vite": "^5.4.12",
"vite-plugin-dts": "^4.2.2",
"verdaccio": "6.1.2",
"vite": "6.2.6",
"vite-plugin-dts": "4.5.3",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-externalize-deps": "^0.8.0",
"vite-tsconfig-paths": "^4.3.2",
Expand All @@ -128,8 +129,7 @@
"dependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"browserstack-node-sdk": "1.34.17",
"nx-cloud": "19.1.0"
"browserstack-node-sdk": "1.34.17"
},
"pnpm": {
"overrides": {
Expand Down
4 changes: 4 additions & 0 deletions packages/javascript-sdk/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
{
"files": ["*.ts", "*.js"]
}
],
"ignorePatterns": [
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*"
]
}
17 changes: 16 additions & 1 deletion packages/javascript-sdk/src/config/helpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { convertWellKnown } from './helpers';
import { frWellKnown, piWellKnown } from './well-known.mock';
import { frWellKnown, newPiWellKnown, piWellKnown } from './well-known.mock';

describe('Test config helpers', () => {
it('should test wellknown response conversion ForgeRock', () => {
Expand Down Expand Up @@ -33,4 +33,19 @@ describe('Test config helpers', () => {
};
expect(result).toStrictEqual(expected);
});

it('should test the new wellknown response conversion from Ping', () => {
const result = convertWellKnown(newPiWellKnown);
const expected = {
baseUrl: 'https://auth.pingone.ca',
paths: {
accessToken: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/token',
authorize: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/authorize',
endSession: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/idpSignoff',
revoke: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/revoke',
userInfo: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/userinfo',
},
};
expect(result).toStrictEqual(expected);
});
});
2 changes: 1 addition & 1 deletion packages/javascript-sdk/src/config/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function convertWellKnown(data: WellKnownResponse, options?: ServerConfig
...(authenticateUrl ? { authenticate: new URL(authenticateUrl).pathname } : {}),
authorize: new URL(data.authorization_endpoint).pathname,
accessToken: new URL(data.token_endpoint).pathname,
endSession: new URL(data.end_session_endpoint).pathname,
endSession: new URL(data.ping_end_idp_session_endpoint || data.end_session_endpoint).pathname,
userInfo: new URL(data.userinfo_endpoint).pathname,
revoke: new URL(data.revocation_endpoint).pathname,
...(sessionsUrl ? { sessions: new URL(sessionsUrl).pathname } : {}),
Expand Down
1 change: 1 addition & 0 deletions packages/javascript-sdk/src/config/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ interface WellKnownResponse {
token_endpoint: string;
userinfo_endpoint: string;
end_session_endpoint: string;
ping_end_idp_session_endpoint?: string;
introspection_endpoint: string;
revocation_endpoint: string;
jwks_uri?: string;
Expand Down
87 changes: 87 additions & 0 deletions packages/javascript-sdk/src/config/well-known.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,90 @@ export const piWellKnown = {
],
code_challenge_methods_supported: ['plain', 'S256'],
};

export const newPiWellKnown = {
issuer: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as',
authorization_endpoint:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/authorize',
pushed_authorization_request_endpoint:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/par',
token_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/token',
userinfo_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/userinfo',
jwks_uri: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/jwks',
end_session_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/signoff',
ping_end_idp_session_endpoint:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/idpSignoff',
introspection_endpoint:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/introspect',
revocation_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/revoke',
device_authorization_endpoint:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/device_authorization',
claims_parameter_supported: false,
request_parameter_supported: true,
request_uri_parameter_supported: false,
require_pushed_authorization_requests: false,
scopes_supported: ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'],
response_types_supported: [
'code',
'id_token',
'token id_token',
'code id_token',
'code token',
'code token id_token',
],
response_modes_supported: ['pi.flow', 'query', 'fragment', 'form_post'],
grant_types_supported: [
'authorization_code',
'implicit',
'client_credentials',
'refresh_token',
'urn:ietf:params:oauth:grant-type:device_code',
],
subject_types_supported: ['public'],
id_token_signing_alg_values_supported: ['RS256'],
userinfo_signing_alg_values_supported: ['none'],
request_object_signing_alg_values_supported: [
'none',
'HS256',
'HS384',
'HS512',
'RS256',
'RS384',
'RS512',
],
token_endpoint_auth_methods_supported: [
'client_secret_basic',
'client_secret_post',
'client_secret_jwt',
'private_key_jwt',
],
token_endpoint_auth_signing_alg_values_supported: [
'HS256',
'HS384',
'HS512',
'RS256',
'RS384',
'RS512',
],
claim_types_supported: ['normal'],
claims_supported: [
'sub',
'iss',
'auth_time',
'acr',
'name',
'given_name',
'family_name',
'middle_name',
'preferred_username',
'profile',
'picture',
'zoneinfo',
'phone_number',
'updated_at',
'address',
'email',
'locale',
],
code_challenge_methods_supported: ['plain', 'S256'],
};
Loading
Loading