I am trying to connect a Discourse installation with a Drupal installation via OAuth2, as described in this post.
Modules:
- OAuth2 Login Provider
- OAuth2 Server
- Services
- REST Server
Expected:
Callback to http://DRUPAL/oauth2/user/profile should not return 404
Actual:
In DISCOURSE logs, the following error appears:
OpenURI::HTTPError (404 Not found : Could not find the controller.)
/usr/local/lib/ruby/2.0.0/open-uri.rb:353:in 'open_http'
In the DRUPAL system's apache logs, the following error appears:
DRUPAL x.x.x.x - - [04/May/2016:00:19:42 -0000] "GET /oauth2/user/profile HTTP/1.1" 404 4382 "-" "Ruby"
Any thoughts on how to move forward from here, or how to properly test /oauth2/user/profile to see why it gives a 404?
Comments
Comment #2
dashohoxha commentedIn the Drupal logs you have
GET /oauth2/user/profile HTTP/1.1, but the homepage of oauth2_loginprovider explicitly says that you need a POST request:Comment #3
dashohoxha commentedYou can also look at the tests for an example: http://cgit.drupalcode.org/oauth2_loginprovider/tree/tests/oauth2_loginp...
Comment #4
dashohoxha commentedComment #5
tarek commentedThank you very much. I will try this and get back to you. Thank you. Also, is there no way to make it accept GET as well?
tarek : )
Comment #6
tarek commentedI have filed a bug with discourse related to lack of POST support in callback.
tarek : )
Comment #7
dashohoxha commentedoauth2_loginprovider depends on oauth2_server, and as far as I know (if things have not changed lately), oauth2_server accepts the access token only through the HTTP header "Authorization: Bearer access_token", not in th URL, and the request has to be a POST request. They argue that this is in compliance with OAuth2 standards. So, I think that it will not work if I tried to make it accept a GET request.
Comment #8
dashohoxha commentedI will give it a try.
Comment #9
dashohoxha commentedComment #10
dashohoxha commentedFixed by this commit: http://cgit.drupalcode.org/oauth2_loginprovider/commit/?id=e91085e
A new version that includes this feature will be released soon.
Comment #11
dashohoxha commented@tarek, you can test the new release and, if it works as expected, close this issue.