Hi all,

I am new to OAuth module. I installed this module in my local site. I need to access my local site from other application. Can you guide me how to use this OAuth module.

Thanks & Regards
Sarav.

Comments

radheyshyam’s picture

Priority: Normal » Critical

I am also unable to find how to used oauth modue, Please help some one.

Thanks,

vikom’s picture

Priority: Critical » Normal

If you want to access your site from another application you maybe want to have a look at the Services module also. There is an option in Services to use authentication which relies on the Oauth module. But it depends on what you want to do? The Oauth module can be used to make your Drupal site a Oauth provider like Facebook, Twitter, GitHub etc.

If that is not what you're looking for could you please be a bit more descriptive?

This is not critical since the module works as designed.

radheyshyam’s picture

Can some one describe OAuth module using a example,
step follow to create a example like ,
a web user (resource owner) can grant a printing service (client) access to her private photos stored at a photo sharing service (server), without sharing her username and password with the printing service.

patcon’s picture

So could this create, say, a runkeeper app that writes to their Health Graph?
http://developer.runkeeper.com/healthgraph/registration-authorization

Trying to figure out whether this just authenticates, or can be used to turn drupal sites in apps for other platforms :)

Thanks!

prodigeek’s picture

Can someone please give more detail about setting Oauth up? Particularly with Services? I having tons of trouble with it.

almul0’s picture

Hi, I am setting up a environment with this module.

I spent a lot of hour understanding how it works. Cause I am connecting one drupal as provider (http://drupal.org/project/oauthloginprovider), and other as consumer with the module oauth connector (http://drupal.org/project/oauthconnector), I have been debugged all the steps.

This is my actual configuration to get it working:
Provider:

  • Oauth - 6.x-3.0-beta4
  • Autoload - 6.x-2.1
  • OauthLoginProvider - 6.x-1.1
  • Chaos Tools - 6.x-1.x-dev
  • Services - 6.x-3.1

Enabling modules:
Enable oauth provider with all its dependencies also enable oauth login provider ui wich comes with oauth module.

So, hands on:
In http://yoursite.com/admin/settings/oauth/ have the configuration for oauth and its contexts, there is one by default wich provides single login.
You can create different contexts to create some level of access.

Obviusly, you need to enable your site as a oauth provider in the options section.

Then in http://yoursite.com/admin/build/services you can configure all your enabled services. You can edit the system resources that can be accessed from the outside, set auth context and edit the endpoint.

With this, you have enabled in your system a exposed oauth system.

In order to access this system you need to create a App Key and a secret to use with the client:

For example, go to your admin user page, http://yoursite.com/user/1 and then go to authorization > Add Consumer.

There you can create the pair keys to use with a consumer.

I have created some tweaks for this module in order to have it working as I want. I will propose them as features soon.

I expect this help you in some way.

Be careful, if you are using php5.2 in cgi mode:

    // If we have running php5.2 as cgi, and defined in htaccess this directive
    // RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    // We need this to get it working
    // Ref: http://drupal.org/node/328222
    if (!isset($out['HTTP_AUTHORIZATION']) && isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']))
    {
      $out['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
    }

I've put this snippet in lib/OAuth.php:819 for get it working.

basvredeling’s picture

Thanks almul0,

this seems like a good start for the sorely missed documentation on both oauthconnector and oauthloginprovider modules.
I've placed such a request right here: http://drupal.org/node/1392384