Skip to content
This repository has been archived by the owner. It is now read-only.

Bad request when getting access_token #14

Open
regisin opened this issue May 3, 2019 · 2 comments
Open

Bad request when getting access_token #14

regisin opened this issue May 3, 2019 · 2 comments

Comments

@regisin
Copy link

regisin commented May 3, 2019

I followed the steps and had the webapp running locally. When I login with my github account, and the callback url is called, it returns a "Bad request" error.

This is what I see in the console:

$ flask run
 * Serving Flask app "app/app.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 237-487-250
127.0.0.1 - - [03/May/2019 04:27:06] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [03/May/2019 04:27:06] "GET /static/css/style.css HTTP/1.1" 200 -
127.0.0.1 - - [03/May/2019 04:27:06] "GET /static/css/colors.css HTTP/1.1" 200 -
127.0.0.1 - - [03/May/2019 04:27:06] "GET /static/img/logo.png HTTP/1.1" 200 -
127.0.0.1 - - [03/May/2019 04:27:07] "GET /static/favicon.ico HTTP/1.1" 200 -
127.0.0.1 - - [03/May/2019 04:27:44] "GET /auth/login/github HTTP/1.1" 302 -
127.0.0.1 - - [03/May/2019 04:27:55] code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03ä\x95IZa\x1ee"ô\x0e2\x0fêB\x98KÀ\x8cp^4.k\x88ζÍ\x1eÃï$L ÅD¤D\x05\x10\x9a>-iñ¶àNN×\x13Q²íÆ\x8dÝL*lÆ*;%\x04\x8b\x00"úú\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
127.0.0.1 - - [03/May/2019 04:27:55] "üä�IZae"ô2êB�KÀ�p^4.k�ζÍÃï$L ÅD¤D�>-iñ¶àNN×Q²íÆ�ÝL**;%�"úúÀ+À/À,À0̨̩ÀÀ��/5" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [03/May/2019 04:27:55] code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03©i¦ë*\x9cCÃ\x99Ûº"¡8\tiw+*Ü6Ó,\x8a¦À=n\x98ÜHà £é\tyÆK\x92§+Q\x90åÄ\x95>\x01\x1a\x7fÊFÇ!ý\x93+,ç\x87¤\x16Që\x00"::\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
127.0.0.1 - - [03/May/2019 04:27:55] "ü©i¦ë*�CÃ�Ûº"¡8	iw+*Ü6Ó,�¦À=n�ÜHà £é	yÆK�§+Q�åÄ�>ÊFÇ!ý�+,ç�¤Që"::À+À/À,À0̨̩ÀÀ��/5" HTTPStatus.BAD_REQUEST -
127.0.0.1 - - [03/May/2019 04:27:55] code 400, message Bad request version ('\x8a\x8aÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
127.0.0.1 - - [03/May/2019 04:27:55] "ÿf»N�kÿÑP´[	rÍãø¢û@Hf�õbWPNN°��À+À/À,À0̨̩ÀÀ��/5" HTTPStatus.BAD_REQUEST 

I couldn't find the documentation for the github api (https://github.com/login/oauth/access_token) that the get_token() method calls to check if the params were ok.

I'm not sure what other information is needed to debug/solve this issue.

@FrancisBehnen
Copy link

FrancisBehnen commented Jun 6, 2019

Are you sure your database is working? How did you set it up? I got something similar when I pointed the website to a database that already contained a user table.

@shafiemukhre
Copy link
Contributor

Setup the callback link with http request. http://localhost:5000/auth/callback/github instead of https://localhost:5000/auth/callback/github

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants