#Sign in flow not working on deployment on AWS Amplify

28 messages · Page 1 of 1 (latest)

agile needle
#

I am using the Clerk, Convex template and the sign in flow on the frontend works on my local deployment. However, it does not work on the deployment that we have on AWS Amplify. Is there a configuration that we are missing causing this issue? Here is a screenshot of the env variables configured within Amplify

#

On the deployment in Amplify the user is rerouted back to the page with the sign in button, however, this time nothing happens even when they click sign in. So I am guessing that nothing the user's credentials are coming to the frontend but for some reason its not being processed right

misty hemlock
#

Is this deployment for a production or non-production branch?

#

I don't know how it works in Vite, but the Next.js env var has a public modifier in the name:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY

mild pumice
agile needle
#

whats weird is that the frontend, and auth works on local but on the AWS Amplify deployment

misty hemlock
#

What is your amplify deployment URL?

agile needle
misty hemlock
#

I just went through the Google Sign in and saw this:

#

This might be an issue between Clerk dev mode and Google dev mode

#

You also seemed to add some username field. Not sure what this is for

agile needle
#

what is confusing is that this works locally, so not sure why it wont work on AWS Amplify with the same env variables

agile needle
agile needle
#

Upon verifying the traffic between clerk and the frontend on amplify, I can see that clerk is sucessfully sending back the jwt token to the frontend, however the frontend logic is not able to retrieve this properly. But again, as I said earlier this is weird as this works locally

agile needle
#

This means that clerk is doing its join in giving the JWT token however the Authenticated component from convex/react is missing configuration?

agile needle
#

@misty hemlock any ideas on what could be the issue?

misty hemlock
#

Not off the top of my head. I think you need to go through each step in the auth/debug webpage the sshader referenced

tired umbra
#

@agile needle when I try this I see

Failed to authenticate: "No auth provider found matching the given token", check your server auth config
#

What does your convex/auth.config.ts look like?

#

If you're using two different CLerk configs for dev and prod then you'll want to list both of them in convex/auth.config.ts

tired umbra
#

https://jwt.io/ says my token is

{
  "aud": "convex",
  "azp": "https://main.dlriba99c1q5m.amplifyapp.com",
  "email": "me@ballingt.com",
  "email_verified": true,
  "exp": 1733822520,
  "family_name": "Ballinger",
  "given_name": "Tom",
  "iat": 1733786520,
  "iss": "https://flowing-pangolin-4.clerk.accounts.dev",
  "jti": "04<REDACTED>d2",
  "name": "Tom Ballinger",
  "nbf": 1733786515,
  "phone_number": null,
  "phone_number_verified": false,
  "picture": "https://img.clerk.com/ey<REDACTED>fQ",
  "sub": "user_2q<REDACTED>BN",
  "updated_at": 1733785205,
  "username": "thomasballinger"
}

so applicationID should be "convex" and domain should be https://flowing-pangolin-4.clerk.accounts.dev

agile needle
#
export default {
  providers: [
    {
      // Configure CLERK_JWT_ISSUER_DOMAIN on the Convex Dashboard
      // See https://docs.convex.dev/auth/clerk#configuring-dev-and-prod-instances
      domain: process.env.CLERK_JWT_ISSUER_DOMAIN,
      applicationID: "convex",
    },
  ],
};
#

I noticed that my CLERK_JWT_ISSUER_DOMAIN was configured incorrectly in the prod instance in convex and hence it was not working

#

issue is fixed now

#

authentication works