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

Bug: Auth Not Working! - Client_id not valid #150

Closed
nelsonic opened this issue Feb 2, 2023 · 10 comments
Closed

Bug: Auth Not Working! - Client_id not valid #150

nelsonic opened this issue Feb 2, 2023 · 10 comments
Assignees

Comments

@nelsonic
Copy link
Member

nelsonic commented Feb 2, 2023

Just tried to authenticate by clicking the Login button on: https://phoenix-chat.fly.dev
Got the following:

image

Please investigate! 🙏

@nelsonic
Copy link
Member Author

nelsonic commented Feb 2, 2023

@LuchoTurtle do you have access to the authdemo app on Fly.io and the phoenix-chat to debug this? 💭
If not, please LMK and I will add you. (sorry I don't have Fly.io open right now to check ...)

@LuchoTurtle
Copy link
Member

I'll look into it.

@nelsonic
Copy link
Member Author

nelsonic commented Feb 2, 2023

Thanks. I think it will make sense to get this working before doing the update #149
to ensure that we know it's working. 👌

@LuchoTurtle
Copy link
Member

Tried changing the auth_api_key secret but it didn't work.
https://github.com/dwyl/phoenix-chat-example/actions/runs/4028445385/jobs/7024474099

@LuchoTurtle LuchoTurtle changed the title Bug: Auth Not Working! Bug: Auth Not Working! - Client_id not valid Feb 2, 2023
@LuchoTurtle
Copy link
Member

Can't replicate the issue. It works on localhost.

image

Imma keep trying

@LuchoTurtle
Copy link
Member

Fly.io logs show the following.

GET / > auth_client_id: 88SwQE3rB7oiK3HFgeZSmscEU4C2ggqraUCyyxepZi8xj5WLzBBR, msg: auth_client_id: 88SwQE3rB7oiK3HFgeZSmscEU4C2ggqraUCyyxepZi8xj5WLzBBR is not valid index in auth controller, referer: https://phoenix-chat.fly.dev/ person:6

@LuchoTurtle
Copy link
Member

LuchoTurtle commented Feb 2, 2023

Trying to get https://github.com/dwyl/auth to work but no luck. Even after setting up the ADMIN_EMAIL env, I keep getting this error:

** (ArgumentError) construction of binary failed: segment 2 of type 'binary': expected a binary but got: nil

dwyl/auth#266

@nelsonic
Copy link
Member Author

nelsonic commented Feb 3, 2023

Sorry, I should have been clearer. It's just the key that is invalid. This is a 1 minute fix:

Goto: https://authdemo.fly.dev/apps/10 and copy the AUTH_API_KEY variable.

Then following the instructions in: https://fly.io/docs/reference/secrets/ run the command:

flyctl secrets set AUTH_API_KEY=88Sabcdetc./88Setc./authdemo.fly.dev

Output:

Release v20 created
==> Monitoring deployment
Logs: https://fly.io/apps/phoenix-chat/monitoring

 1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]
--> v20 deployed successfully

Working:

phx-chat-auth-working.mov

But that UI bug at the bottom of the page is bugging me: #151 Please fix! 🙏

@nelsonic nelsonic closed this as completed Feb 3, 2023
@LuchoTurtle
Copy link
Member

LuchoTurtle commented Feb 3, 2023

I changed the secret through Github secrets and re-ran the job to re-deploy, shouldn't it have worked?

@nelsonic
Copy link
Member Author

nelsonic commented Feb 3, 2023

Changing the secret on GitHub will only affect the CI; the key will not be deployed/updated to Fly.io.
Invalid client_id just means the AUTH_API_KEY is invalid.
So updating it on Fly.io was my logical/immediate response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants