Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hoping to play around and contribute this back when I make some headway. Just wanted to post so that I don't forget to contribute back :)
Comment | File | Size | Author |
---|---|---|---|
#11 | 1746386-11-hardcode-json-accept-header.patch | 523 bytes | patcon |
#7 | oauthconnector-add-github-support-1746386-6.patch | 1.82 KB | jsacksick |
Comments
Comment #1
patcon CreditAttribution: patcon commentedNot sure whether more presets are useful or best kept in another module, but here it is, just in case. Only been testing locally, so haven't done the final bit of testing to prove that it completely works :)
https://github.com/patcon/oauthconnector_github
Comment #2
patcon CreditAttribution: patcon commentedStill toying around with this. Was getting an issue on my local VM, so just recently got around to trying on a Rackspace server, thinking oauth didn't work locally. Found the same error happening, and so dug in to discover that local development shouldn't make a difference.
I'll work on packaging up my setup to work with the Ariadne vagrant development VM, so that anyone interested in GitHub testing can reproduce the error with very little effort :)
That krumo output above is for
dpm($options)
from right beforecurl_init()
inget()
Comment #3
patcon CreditAttribution: patcon commentedOh, and here's an install profile sans the client and secret keys:
https://github.com/patcon/drupalgithub
Comment #4
Jon PughI was getting the same thing, thankfully I found your github module and realized its not just my problem...
Trying to solve this. After hours of staring at the request it still looks right to me...
Found this description of HTTP 406 code that might help:
https://github.com/WhiteHouse/api-standards/issues/12
Comment #5
Jon PughWell, I'll be. A fresh night's sleep does wonders.
the current code in DrupalOAuth2Client.inc uses x-www-form-urlencoded
I changed it to 'application/json' and voila! It works!
Now... I guess we need to patch oauthconnector?
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedThank you for that fix very much :)
Comment #7
jsacksick CreditAttribution: jsacksick commentedHere's the patch that adds the preset, I haven't touched the $headers array.
Comment #8
patcon CreditAttribution: patcon commentedDitto what @alex_bytsiuk said :) Thanks @jonpugh!
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commented@jsacksick but your patch don't solve the problem. Did you try to fix the bug or just add GitHub as preset provider?
Comment #10
patcon CreditAttribution: patcon commentedalex_bytsiuk++
Appreciate the patchifying @jsacksick, but I wasn't looking to get a github preset into core, since that's why the module is extensible
Comment #11
patcon CreditAttribution: patcon commentedMeh. I know it's not the right approach to get accepted into the module, but here's the patch for @jonpugh's hack :)
Comment #12
dxx CreditAttribution: dxx commentedPatch "resolve" issue for me. Using "application/json" does not break others providers (tested with Google, Twitter, Facebook, Linkedin and GitHub).
For get the email field from GitHub profil you need to use "user" in scope and "https://api.github.com/user/emails" at ressource but it's not possible to map a array field, one solution? It's possible with QueryPath?
Found! (no QueryPath required) simply use: "0.email".