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

chore(auth): add oauth metadata into token orchestrator #13712

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

israx
Copy link
Member

@israx israx commented Aug 14, 2024

Description of changes

This change adds oauth metadata into the token orchestrator. This metadata is set after the user has authenticated via OAuth, and it can be accessed from the current KeyValueStorage (LocalStorage, SessionStorage, CookieStorage, etc).

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

expect(mockOAuthSignOutRedirect).toHaveBeenCalledWith(cognitoConfig);
});

it('should complete OAuth sign out and redirect when there oauth metadata in tokenOrchestrator', async () => {
Copy link
Member

@jimblanc jimblanc Aug 14, 2024

Choose a reason for hiding this comment

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

Sanity check: Are there more tests we can add? E.g. signing out of an existing session without this meta-data in storage, error cases, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous tests are already signing out without depending on this metadata in storage already. Further test cases will be introduced by the e2e test

@israx israx merged commit e68b2d6 into aws-amplify:chore/oauth-metadata Aug 16, 2024
28 checks passed
@israx israx deleted the fix/oauth-logout branch August 16, 2024 20:22
israx added a commit to israx/amplify-js that referenced this pull request Aug 20, 2024
…13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
israx added a commit to israx/amplify-js that referenced this pull request Aug 20, 2024
…13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
israx added a commit that referenced this pull request Aug 20, 2024
* wip: hardcode signout uri for poc

* chore: expose the prefferedRedirectSignOutUrl

* chore: add prefered url change to native file

* chore: correct param name

* chore: update getRedirectUrl function to consider preferred url

* chore: add unit test for the feature

* chore: update input type to use the accepted format

* chore: review comments

* fix: address npm audit issues

* chore: update comments, bundle size and rn version

* chore: update bundle size limit

* chore: update bundle size limit

* chore: address coments and rename a param to getRedirecturl funciton

* chore: make preid release ready

* chore: update yarn.lock

* chore: add test and update push-integ branch

* chore: revert preid release updates

* chore: update sample name

* chore: update yarn.lock

* chore(auth): add oauth metadata into token orchestrator (#13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback

* chore: fix unit tests

* chore: enable tests in ci

---------

Co-authored-by: ManojNB <manojnb95@gmail.com>
israx added a commit to israx/amplify-js that referenced this pull request Aug 20, 2024
…13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
israx added a commit that referenced this pull request Aug 20, 2024
)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
israx added a commit to israx/amplify-js that referenced this pull request Aug 21, 2024
…13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
israx added a commit that referenced this pull request Aug 21, 2024
* chore: enable subdomains e2e test

* chore(auth): add oauth metadata into token orchestrator (#13712)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback
Samaritan1011001 added a commit that referenced this pull request Sep 3, 2024
* chore(auth): add oauth metadata into token orchestrator (#13712) (#13736)

* chore: add oauth metadata into token orchestrator

* chore: add unit tests

* chore: address feedback

* wip: hardcode signout uri for poc

* chore: expose the prefferedRedirectSignOutUrl

* chore: add prefered url change to native file

* chore: correct param name

* chore: update getRedirectUrl function to consider preferred url

* chore: add unit test for the feature

* chore: update input type to use the accepted format

* chore: review comments

* fix: address npm audit issues

* chore: update comments, bundle size and rn version

* chore: update bundle size limit

* chore: update bundle size limit

* chore: address coments and rename a param to getRedirecturl funciton

* chore: make preid release ready

* chore: update yarn.lock

* chore: add test and update push-integ branch

* chore: revert preid release updates

* chore: update sample name

* chore: enable react native tests with localhost server

* chore: enable subdomain test

* chore: update some function calls in tests

* chore: minor reverts

* fix: unit tests fail on mehtod params

* chore: revert ppush branch

* chore: remove subdomain test rdundant

* chore: upadte step name

* chore: reflect API changes and clean up

* chore: revert unintented change glob

* chore: bundle size minor adjustments

* chore: move localhost page hosting to RN script in the app

* chore: revert unintended change

* chore: revert branch name for integ test

---------

Co-authored-by: israx <70438514+israx@users.noreply.github.com>
Co-authored-by: AllanZhengYP <zheallan@amazon.com>
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.

4 participants