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

Reopen: Unable to get Subscription context from lambda Custom Auth #2090 #2843

Open
2 tasks done
wulianer opened this issue Sep 5, 2024 · 3 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@wulianer
Copy link

wulianer commented Sep 5, 2024

How did you install the Amplify CLI?

N/A

If applicable, what version of Node.js are you using?

N/A

Amplify CLI Version

N/A

What operating system are you using?

iOS

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

NO

Describe the bug

Reopen this ticket #2090

The issue still exists and no solution yet.

Expected behavior

The field "queryString" should be populated with the query, and the field "variables" should be populated with the variables.

Reproduction steps

Configure the AppSync API to use Lambda Auth
Try to subscribe to a mutation method from AWS AppSync Console.

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@MichaelPHanley
Copy link

This is also happening to us both from the AWS AppSync console and in code. On occasion subscriptions will work and we can subscribe, but the majority of the time queryString and variables are empty and we are unable to validate requests.

We have no issues with Queries or Mutations running through Lambda Auth only subscriptions.

@MichaelPHanley
Copy link

After some troubleshooting, I'm nearly certain this results from AppSync sending the connection init message to the authorizer. This message doesn't contain the query or the variables. The start subscription message will include them. So if you do not allow the init to go through, neither will the variables or query.

This presents other problems with lambda auth caching in AppSync because the token is already authorized and cached without actually validating the values from the query.

@AnilMaktala
Copy link
Member

Hi @wulianer, Thank you for bringing this up and conducting further analysis. As you mentioned, this issue needs to be addressed by the AppSync team. We will raise a ticket with them and keep this one updated with any progress.

@AnilMaktala AnilMaktala added api-graphql bug Something isn't working and removed api-graphql pending-triage labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants