Skip to content

fix(api): cognito user pool intercept with accessToken #690

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 2 commits into from
Aug 10, 2020

Conversation

lawmicha
Copy link
Contributor

@lawmicha lawmicha commented Aug 5, 2020

Issue #, if available:
#618

Description of changes:
This updates the Cognito User Pool interceptor to use the accessToken. Android and JS is using accessToken, while iOS was using idToken before. According to the AWS docs, both can be passed to the service.

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

@lawmicha lawmicha self-assigned this Aug 5, 2020
@lawmicha lawmicha requested a review from royjit August 5, 2020 19:06
@lawmicha lawmicha added the api Issues related to the API category label Aug 5, 2020
@lawmicha lawmicha added this to the 1.1.0 milestone Aug 10, 2020
Copy link
Contributor

@royjit royjit left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment.

func testGetAPIFailedWithNotAuthenticated() {
AuthHelper.signOut()
func testGetAPIFailedWithSignedOutError() {
signOut()
Copy link
Contributor

Choose a reason for hiding this comment

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

User is already signout at this stage, do we need to call it again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah no need to call it again, i had this when i was debugging the tests, in a normal test run, this is covered already in the tearDown. removing this line

…ESTWithUserPoolIntegrationTests/RESTWithUserPoolIntegrationTests.swift
@lawmicha lawmicha merged commit 62d8c0c into main Aug 10, 2020
@lawmicha lawmicha deleted the fix/api-intercept-idtoken branch August 10, 2020 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants