Skip to content
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

feat: update okta login guide for realworld app #4883

Merged
merged 3 commits into from
Dec 2, 2022

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Nov 30, 2022

Adds new cy.origin() guide for okta as primary recommendation over programmatic login. realworld-app update PR: cypress-io/cypress-realworld-app#1293

The test cases for okta are a bit different because I could not get the onboarding workflow to load and couldn't figure out why and didn't have the time to debug the issue. The user is definitely logged in, but might not be considered a new user.

@vercel
Copy link

vercel bot commented Nov 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cypress-documentation ✅ Ready (Inspect) Visit Preview Dec 2, 2022 at 2:54PM (UTC)

@AtofStryker AtofStryker marked this pull request as ready for review November 30, 2022 22:37
@AtofStryker AtofStryker changed the title feat: update cognito login guide for realworld app feat: update okta login guide for realworld app Nov 30, 2022
@@ -7,9 +7,9 @@ e2eSpecific: true

## <Icon name="graduation-cap"></Icon> What you'll learn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty much the same feedback as #4882

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once we settle on #4882 ill add the same feedback here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made same updates from #4882 in 31b0c6c

<Alert type="success">

The
[runnable version of this test](https://github.com/cypress-io/cypress-realworld-app/blob/develop/cypress/tests/ui-auth-providers/okta.spec.ts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the custom command found in this file or the support file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support file, which in the code snippet at the top has something like cypress/support/auth-provider-commands/okta.ts. I'm hopiong thats enough to make it discoverable since that is what we've done elsewhere, even though just clicking on the custom command just takes you the the typings definition

Next, we will write a command named `loginByOktaApi` to perform a programmatic
login into [Okta](https://okta.com) and set an item in localStorage with the
authenticated users details, which we will use in our application code to verify
we are authenticated under test.

In order to make sure this is enabled inside the
[Cypress Real World App](https://github.com/cypress-io/cypress-realworld-app),
Please set the `REACT_APP_OKTA_PROGRAMMATIC` environment variable to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this ENV needed? Also do we need to call it out here or can we link to a section in the read me to share how to set this up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added REACT_APP_OKTA_PROGRAMMATIC since the programmatic approach strips the auth guards out of the webapp, which we don't want with UI login with cy.origin() since we want to test how the app actually behaves and get the natural redirect to the auth page when we aren't authenticated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured here is fine since the README just points back to the guide

@AtofStryker AtofStryker merged commit 0dabe52 into v12 Dec 2, 2022
@AtofStryker AtofStryker deleted the feat/update-okta-guide branch December 2, 2022 15:08
debrisapron pushed a commit that referenced this pull request Dec 6, 2022
* feat: update okta login guide for realworld app

* chore: make changes to okta to have parity with cognito changes

* chore: address code review comments
mjhenkes added a commit that referenced this pull request Dec 6, 2022
* Remove pages and references to functionality obsoleted by multidomain GA

* fix: Explain error thrown when cypress commands in .should() callback (#4755)

* fix: Explain error thrown when cypress commands in .should() callback

* Improve layout of previous changes and provide second example of how to fix

* Update content/api/commands/should.md

Co-authored-by: Rachel <[email protected]>

* Apply suggestions from code review

Co-authored-by: Zach Bloomquist <[email protected]>

* Run prettier

* Run prettier again...?

* One more prettier run... :/

Co-authored-by: Rachel <[email protected]>
Co-authored-by: Zach Bloomquist <[email protected]>

* docs: removing Cookies.defaults/preserveOnce (#4779)

* docs: remove experimentalSessionAndOrigin (#4807)

* Update cookie commands domain option description (#4861)

* docs: Queries, Detached DOM, and Retry-Ability (#4835)

* First rework of retryability guide

* Update each command's Yields section, and all guides, with information about queries vs commands

* Add Custom Queries page

* Minor formatting tweaks

* Review changes

* Review updates

* Update based on review + last week meetings

* More review updates

* Fix tests

* breaking: drop node 12, 13, 15 and 17 support (#4879)

* Add docs for new local/session storage commands (#4876)

* feat: update okta login guide for realworld app (#4883)

* feat: update okta login guide for realworld app

* chore: make changes to okta to have parity with cognito changes

* chore: address code review comments

* feat: update cognito login guide for realworld app (#4882)

* feat: update cognito login guide for realworld app

* chore: update guide from comments in code review

* properly close alert tag

* Update content/guides/end-to-end-testing/amazon-cognito-authentication.md

* chore: address comments from code review

* fix linting

* v12 Migration Guide (#4862)

Co-authored-by: Matt Schile <[email protected]>
Co-authored-by: Blue F <[email protected]>
Co-authored-by: DEBRIS APRON <[email protected]>
Co-authored-by: Ben M <[email protected]>
Closes undefined

* Small update to cy.origin API docs for v12

* Update auth examples for v12 on custom commands page

* 12: update test isolation docs to use true/false instead of on/off (#4890)

Co-authored-by: Chris Breiding <[email protected]>
Co-authored-by: Matt Henkes <[email protected]>
Co-authored-by: Bill Glesias <[email protected]>

* docs: add documentation for experimentalOriginDependencies (#4897)

* Documentation updates for v12 (#4880)

* re-add websecurity, links to websecurity, and trade-offs guides

* chore: revamp documentation around web security page

* chore: update same-origin tradeoff to be new navigation rules, including our SD chart, to help paint users a clear picture with cy.origin

* chore: link to the experimental modify obstructive third party code doc in web security from origin

* chore: update Error Messages section to reflect allowing cross origin visiting

* update best practices: visiting external sites

* remove node 12 from installing cypress section

* chore: update key differences to plug session and origin over programmatic login

* chore: update with suggestions from code review

* add okta/amazon guide links in trade-offs and update workarounds

* feat: add cross origin testing guide

* update image for command time out with visit

* chore: readd legacy errors and add a Note section to explain that this is only for cypress v11 and under

* chore: update suggestions from code review

* chore: add suggestions from code review

* fix: fix okta alert banner (needed a new line)

* fix: broken image in error messages

* chore: update error header for on link to address cypress-io/cypress-services#5040 (comment)

* Update cy.session API docs for v12 (#4851)

Co-authored-by: Emily Rohrbough <[email protected]>
Closes #4507

* Remove pages and references to functionality obsoleted by multidomain GA

* fix: Explain error thrown when cypress commands in .should() callback (#4755)

* fix: Explain error thrown when cypress commands in .should() callback

* Improve layout of previous changes and provide second example of how to fix

* Update content/api/commands/should.md

Co-authored-by: Rachel <[email protected]>

* Apply suggestions from code review

Co-authored-by: Zach Bloomquist <[email protected]>

* Run prettier

* Run prettier again...?

* One more prettier run... :/

Co-authored-by: Rachel <[email protected]>
Co-authored-by: Zach Bloomquist <[email protected]>

* docs: removing Cookies.defaults/preserveOnce (#4779)

* docs: remove experimentalSessionAndOrigin (#4807)

* Update cookie commands domain option description (#4861)

* docs: Queries, Detached DOM, and Retry-Ability (#4835)

* First rework of retryability guide

* Update each command's Yields section, and all guides, with information about queries vs commands

* Add Custom Queries page

* Minor formatting tweaks

* Review changes

* Review updates

* Update based on review + last week meetings

* More review updates

* Fix tests

* breaking: drop node 12, 13, 15 and 17 support (#4879)

* Add docs for new local/session storage commands (#4876)

* feat: update okta login guide for realworld app (#4883)

* feat: update okta login guide for realworld app

* chore: make changes to okta to have parity with cognito changes

* chore: address code review comments

* feat: update cognito login guide for realworld app (#4882)

* feat: update cognito login guide for realworld app

* chore: update guide from comments in code review

* properly close alert tag

* Update content/guides/end-to-end-testing/amazon-cognito-authentication.md

* chore: address comments from code review

* fix linting

* v12 Migration Guide (#4862)

Co-authored-by: Matt Schile <[email protected]>
Co-authored-by: Blue F <[email protected]>
Co-authored-by: DEBRIS APRON <[email protected]>
Co-authored-by: Ben M <[email protected]>
Closes undefined

* 12: update test isolation docs to use true/false instead of on/off (#4890)

Co-authored-by: Chris Breiding <[email protected]>
Co-authored-by: Matt Henkes <[email protected]>
Co-authored-by: Bill Glesias <[email protected]>

* docs: add documentation for experimentalOriginDependencies (#4897)

* Documentation updates for v12 (#4880)

* re-add websecurity, links to websecurity, and trade-offs guides

* chore: revamp documentation around web security page

* chore: update same-origin tradeoff to be new navigation rules, including our SD chart, to help paint users a clear picture with cy.origin

* chore: link to the experimental modify obstructive third party code doc in web security from origin

* chore: update Error Messages section to reflect allowing cross origin visiting

* update best practices: visiting external sites

* remove node 12 from installing cypress section

* chore: update key differences to plug session and origin over programmatic login

* chore: update with suggestions from code review

* add okta/amazon guide links in trade-offs and update workarounds

* feat: add cross origin testing guide

* update image for command time out with visit

* chore: readd legacy errors and add a Note section to explain that this is only for cypress v11 and under

* chore: update suggestions from code review

* chore: add suggestions from code review

* fix: fix okta alert banner (needed a new line)

* fix: broken image in error messages

* chore: update error header for on link to address cypress-io/cypress-services#5040 (comment)

* Update auth examples for v12 on custom commands page

* Small update to cy.origin API docs for v12

* Update cy.session API docs for v12 (#4851)

Co-authored-by: Emily Rohrbough <[email protected]>
Closes #4507

* chore: address docs feedback post merge (#4899)

* .within() now throws an error if given more than one subject (#4898)

* .within() now throws error when passed more than one subject.

* Add migration guide, update based on reviews

* Update Logging In section of Testing Your App page (#4885)

Co-authored-by: Emily Rohrbough <[email protected]>
Closes #4498

* Update End-to-End Testing -> Auth0 Authentication docs for v12 (#4895)

Co-authored-by: Bill Glesias <[email protected]>

* Cypress.Session Cypress API (#4900)

* docs around Cypress.session api

* data not date

* Update content/api/cypress-api/session.md

Co-authored-by: Matt Henkes <[email protected]>

* Update content/api/cypress-api/session.md

Co-authored-by: Matt Henkes <[email protected]>

* Update content/api/cypress-api/session.md

Co-authored-by: Matt Henkes <[email protected]>

* Update content/api/cypress-api/session.md

Co-authored-by: Matt Henkes <[email protected]>

* fix markdown

* Update content/api/cypress-api/session.md

* Apply suggestions from code review

Co-authored-by: Matt Henkes <[email protected]>

* V12 ChangeLog (#4896)

Co-authored-by: Matt Schile <[email protected]>
Co-authored-by: Blue F <[email protected]>
Co-authored-by: DEBRIS APRON <[email protected]>
Co-authored-by: Ben M <[email protected]>
Co-authored-by: Ryan Manuel <[email protected]>
Co-authored-by: Chris Breiding <[email protected]>

Co-authored-by: DEBRIS APRON <[email protected]>
Co-authored-by: Blue F <[email protected]>
Co-authored-by: Rachel <[email protected]>
Co-authored-by: Zach Bloomquist <[email protected]>
Co-authored-by: Matt Schile <[email protected]>
Co-authored-by: Matt Henkes <[email protected]>
Co-authored-by: Chris Breiding <[email protected]>
Co-authored-by: Bill Glesias <[email protected]>
Co-authored-by: Ben M <[email protected]>
Co-authored-by: Ryan Manuel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants