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

Client Side Token #17

Closed
evanBurg opened this issue May 13, 2019 · 5 comments
Closed

Client Side Token #17

evanBurg opened this issue May 13, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@evanBurg
Copy link

Describe the bug
Attempting to get a client side token returns a 404

To Reproduce
Navigate to https://trefle.io/api/auth/claim

Expected behavior
A client side token an expiry are returned in order to make client side requests to the api

@evanBurg evanBurg added the bug Something isn't working label May 13, 2019
@lambda2
Copy link
Member

lambda2 commented May 14, 2019

Hey Evan, are you sure you performed a "POST" request ? For example, with curl:

curl -i -X POST "https://trefle.io/api/auth/claim?token=YOUR-TOKEN&origin=your-website.rocks"

HTTP/2 200
server: nginx/1.14.0 (Ubuntu)
date: Tue, 14 May 2019 12:07:52 GMT
content-type: application/json; charset=utf-8

{"token":"eyJhbGciOiJIUzI1NiIsItR5cCI6IkpXVCJ9.eyJpcCI6WzQ4LDQ2LDQ4LDQ2LDQ4LDQ2LDQ4XSwiaXNzdWVyX2lkIjoxLCJvcmlnaW4iOiJsYWdhLmNvIiwiYXVkIjoiSm9rZW4iLCJleHAiOjE1NTc4NDI3NjYsImlhdCI3MTU1NzgzNTU2NiwiaXNzIjoiSm9rZW4iLCJqdGkiOiIybWY4bWNjdjc2bWZwdmd2M2swMnR0bDEiLCJuYmYiOjE1NTc8MzU1NjZ9.TJYar9UhYm0TvMSIr_OPZdrXeOuQCiM7XYlmJ2S_9tM","expiration":1557842766}%

@evanBurg
Copy link
Author

Totally my bad, I assumed it was a GET request. I am able to receive a token now, thanks so much for the fast reply.

@FelixEder
Copy link

@lambda2 Hi! I've been getting 500 Internal Server Error when trying to get my client side token through curl. I tried your exact same curl command as in your previous reply, but it still I get a 500. If I change the token I get an error about using an invalid token and if I remove the origin-param I get a 400 instead (but the body still says "Internal Server Error" :P ).

I'm really confused to what the problem might be, my website is
https://goodseeds.web.app
but that doesn't work either.

@lambda2
Copy link
Member

lambda2 commented Mar 26, 2020

Hey @FelixEder, fixed now. Thanks for the feedback and sorry for the inconvenience 🙏

@FelixEder
Copy link

@lambda2 Awesome, thanks a lot! :D

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