2017 © Pedro Peláez
 

library oauthsupport

An OAUTH 2.0 Client Library

image

caseyamcl/oauthsupport

An OAUTH 2.0 Client Library

  • Monday, December 10, 2012
  • by caseyamcl
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3,872 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

OAuth Support

!! NOTICE !!: This package has been abandoned. The author recommends you use league/oauth2-client instead, (*1)


An OAuth 2.0 client library (draft 10 / specification 1), forked from https://github.com/vznet/oauth_2.0_client_php, written by Charron Pierrick and Berejeb Anis, (*2)

LICENSE

This Code is released under the GNU LGPL, (*3)

Please do not change the header of the file(s)., (*4)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version., (*5)

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE., (*6)

See the GNU Lesser General Public License for more details., (*7)

Installation

Via composer/packagist:, (*8)

require {
    ...
    'caseyamcl/Oauthsupport': 'dev-master'
}

Usage

This library includes an abstract class named 'AuthService', which can be extended to create OAuth 2.0 clients for specific services., (*9)

As an example, a Facebook and Google class are included in the code. These classes are fully functional, and can be used in production., (*10)

To create your own client, create a class that extends the Oauth2\AuthService abstract class:, (*11)

class MyOauthClient extends \Oauth2\AuthService
{
    /**
     * Get the Authorization URL
     * 
     * @return string
     */
    public function getAuthUrl()
    {
        return "http://SOME/URL/To/Authorization/Endpoint";
    }

    /**
     * Get the token URL
     * 
     * @return string
     */
    public function getTokenUrl()
    {
        return "http://SOME/URL/To/Token/Endpoint";
    }

    /**
     * Get info once logged-in
     * 
     * @param string $accessToken
     * @return array  Array of info
     */
    public function getInfo($accessToken)
    {
        $infoUrl = 'http://SOME/URL/To/Api/Stuff';
        $this->client->setAccessToken($accessToken);
        return $this->client->get($infoUrl);
    }        
}

The Versions

10/12 2012

dev-master

9999999-dev https://github.com/caseyamcl/Oauthsupport

An OAUTH 2.0 Client Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

authentication oauth client oauth 2.0

10/12 2012

v1.0

1.0.0.0 https://github.com/caseyamcl/Oauthsupport

An OAUTH 2.0 Client Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

authentication oauth client oauth 2.0