-
Notifications
You must be signed in to change notification settings - Fork 3
SDKS-4348: Implement token.revoke in OIDC client #376
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@forgerock/oidc-client': minor | ||
--- | ||
|
||
Implement token `revoke` method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,11 @@ test.describe('User tests', () => { | |
await page.getByRole('textbox', { name: 'Password' }).fill(pingAmPassword); | ||
await page.getByRole('button', { name: 'Next' }).click(); | ||
|
||
await page.waitForURL('http://localhost:8443/ping-am/**'); | ||
await page.waitForURL('http://localhost:8443/ping-am/**', { waitUntil: 'networkidle' }); | ||
expect(page.url()).toContain('code'); | ||
expect(page.url()).toContain('state'); | ||
|
||
await page.getByRole('button', { name: 'User Info' }).click(); | ||
await clickButton('User Info', 'https://openam-sdks.forgeblocks.com/am/oauth2/alpha/userinfo'); | ||
await expect(page.locator('#userInfo')).not.toBeEmpty(); | ||
await expect(page.getByText('Sdk User')).toBeVisible(); | ||
await expect(page.getByText('[email protected]')).toBeVisible(); | ||
|
@@ -48,13 +48,28 @@ test.describe('User tests', () => { | |
await page.getByRole('textbox', { name: 'Password' }).fill(pingOnePassword); | ||
await page.getByRole('button', { name: 'Sign On' }).click(); | ||
|
||
await page.waitForURL('http://localhost:8443/ping-one/**'); | ||
await page.waitForURL('http://localhost:8443/ping-one/**', { waitUntil: 'networkidle' }); | ||
expect(page.url()).toContain('code'); | ||
expect(page.url()).toContain('state'); | ||
|
||
await page.getByRole('button', { name: 'User Info' }).click(); | ||
await clickButton( | ||
'User Info', | ||
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/userinfo', | ||
); | ||
await expect(page.locator('#userInfo')).not.toBeEmpty(); | ||
await expect(page.getByText('demouser')).toBeVisible(); | ||
await expect(page.getByText('[email protected]')).toBeVisible(); | ||
}); | ||
|
||
test('get user info should error with missing token', async ({ page }) => { | ||
const { navigate } = asyncEvents(page); | ||
await navigate('/ping-am/'); | ||
expect(page.url()).toBe('http://localhost:8443/ping-am/'); | ||
|
||
await page.getByRole('button', { name: 'User Info' }).click(); | ||
|
||
await expect(page.locator('#userInfo')).not.toBeVisible(); | ||
await expect(page.locator('.error')).toContainText(`"error": "No access token found"`); | ||
await expect(page.locator('.error')).toContainText(`"type": "auth_error"`); | ||
}); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
networkidle
is an anti-pattern or discouraged.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This true but we use it a lot in our tests rights now. We have a ticket to do a bunch of Playwright updates later on.
https://pingidentity.atlassian.net/browse/SDKS-4331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do use
networkidle
in more places, let's just note it in that Playwright improvement story and leave it for then. Ultimately, I'd like to create a utility function that does this since "clicking a button and waiting for a response" as it is a super common pattern. That was the purpose of the old util file, and I'd like to keep to that goal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the ticket