I am running Drupal 7.x and the following modules are installed:
- Chaos tools
- OAuth
- Services
- Connector
- Http Client
- OAuth Connector
- OAuth Login Provider

However I am unable to get my Drupal to act as an OAuth provider, mainly due to the non-existing documentation about the OAuth modules. I have read all the user-content regarding this, but haven't found anything that would work in my case.

Here is just about what I did (hopefully it will also help others):

1. Went to the admin user and created a new consumer. Set the callback URL to http://localhost/drupal/oauth/request_token
2. Went to the OAuth Connector (under Structure) and added a new custom provider with the key / secret from 1.
3. Then under my account, there was a button that said "Add XXX account", a message appeared and asked if I wanted to authorize the application, clicked yes, and it took me to the callback URL from 1 with an ?oauth_token=HzZzGoMYhyqmVPAhLjJodiRopaZwEvZf on GET. There was no output. When I checked with firebug, the request gave a 401 not authorized error ("no oauth consumer key"). So then I added the consumer key, timestamp, nonce, signature method and... couldn't encode the signature (as far as I can tell it's base64(hmac_sha1(secret))), so I got stuck there.

My question I guess, is... is the flow that I'm following correct? What am I doing wrong?

It would be much more helpful if someone already has this working and could send me either instructions about how to configure it, or a copy of their Drupal if it doesn't have sensitive data.

I am really desperate here and would LOVE some help / opinions.

Thank you.

Comments

ajculle’s picture

I was having the same issues with nothing being documented. The most important thing for me was to use the Dev release of the OAuth module. For some reason the recommended release wouldn't work for me not matter what I did. I was able to connect using this as my client http://term.ie/oauth/example/client.php

sbehun’s picture

You should change your callback URL to somewhere on the client side. The callback should not be {oauth server url}/something/request_token, rather this should be the client who is trying to access the resources (user data) on drupal.

I believe the next step would be grabbing that token as a client, and then using it to access the user's data from drupal (server). That's the part I'm stuck at. Get in touch if you want to work on this together.... its been driving me mad for weeks. I will document everything if I can get some help. This documentation is much needed. Maybe I'll try the dev version and see what happens.