singingwolfboy / flask-dance

Doing the OAuth dance with style using Flask, requests, and oauthlib.
https://pypi.python.org/pypi/Flask-Dance/
MIT License
1.01k stars 158 forks source link

Enable using GET request for token request URL #290

Open s73v3r opened 4 years ago

s73v3r commented 4 years ago

The provider I'm trying to use specifies that I should use a GET request for the token request, and that the parameters (client_id, client_secret, code, redirect_url) should be added as query parameters. Is there a way to enable this behavior?

singingwolfboy commented 4 years ago

Flask-Dance uses requests-oauthlib to handle the OAuth interaction. You can use the token_url_params dict to configure how we call fetch_token(). Here's the relevant Flask-Dance code, and here's the documentation for fetch_token().

Out of curiosity, which OAuth provider is this? I wonder why they handle this as a GET request...

Also, if you manage to get this working, would you mind making a pull request to the documentation to add this information to the docs?

s73v3r commented 4 years ago

The provider I'm working with is Untappd, the beer social network. I couldn't tell you why they do it that way.

Once I get the whole request working (adding the token_url_params fixed that part), I'd be happy to try and update the docs.

singingwolfboy commented 4 years ago

Great, thank you! You could also add a pre-set configuration for Untappd, if you want. They're not much work to write -- mostly just copy-paste from an existing configuration.