GithubHelp home page GithubHelp logo

silvester / reverseoauth2 Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 24.0 245 KB

Another OAuth2 client for ZF2. It provides clients for github, google, facebook and linkedin. It also provides a standart authentication adapter for zend auth. Others soon to come.

PHP 100.00%

reverseoauth2's People

Contributors

machek avatar serusko avatar thinkscape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reverseoauth2's Issues

#FB Error getting access_token

public function getToken(Request $request)
{

    if(isset($this->session->token)) {

        return true;

    } elseif(strlen($this->session->state) > 0 AND $this->session->state == $request->getQuery('state') AND strlen($request->getQuery('code')) > 5) {

        $client = $this->getHttpClient();

        $client->setUri($this->options->getTokenUri());

        $client->setMethod(Request::METHOD_POST);
        $client->setHeaders(array('Accept-encoding' => 'utf-8'));

        $client->setParameterPost(array(
            'code'          => $request->getQuery('code'),
            'client_id'     => $this->options->getClientId(),
            'client_secret' => $this->options->getClientSecret(),
            'redirect_uri'  => $this->options->getRedirectUri()
        ));

        $retVal = $client->send()->getContent();

        parse_str($retVal, $token);

$retval returns strange characters uncoded

print_r($retVal)

GoogleClient does not decode gzip encoded response from authorization server

On line 52 of ReverseOAuth2/Client/Google.php, the call to getContent() returns the raw content of the response message.

If the response message has some kind of encoding (i.e. gzip or some other encoding specified by Content-Encoding or Transfer-Encoding headers), then this content is NOT decoded and the raw encoded bytes will be returned.

If the content is gzipped (for example), this will cause the JSON decoding to fail.

Using the getBody() method of Zend\Http\Response, instead of getContent(), will properly decode the body.

This issue probably exists in other clients, too.

Note: I am seeing this issue when using the Google client to authenticate with Salesforce (they use the same parameter names-- I override the endpoints via config), which returns plaintext JSON responses in most cases, but a gzipped encoded JSON response when exchanging an authorization_code.

#FB not returning user info other than id and name

I'm using latest version of FB app v2.5 for social login.has FB changed the request URL??? I searched lot and get konw about the change that made by FB # ie) .../me?fields=id,name,email..How i can change the request scope into fields in our module.

Documentation

I was curious if you could update your documentation so that it is a little more clear on how to use this module. Installation seemed straight forward, but when it came time to use the module I've found myself to be quite lost.

For example. I create a test module just to experiment with this module. In order to access the URL I have to supply a route to the Controller / Action. I cannot find anywhere how to set the proper route for this module. Is it Literal or Segment or something else? If it's Segment or other, what does the actual route look like?

Setting options programatically

Hi Silvester,

nice work so far. Seems pretty good and easy. I just have one little request:

Could you please add the methods getOptions and setOption($name, $value) to the class AbstractOAuth2Client? The reson for that is that it would be desirable to set e.g. the redirect_uri from within an action?

Thank you very much,
Chris

Google OAuth on Windows

My local dev environment is on Windows. I am assuming this issue won't happen when I push to a *nix box, but wanted to ask here anyways. When I first tried to use your plugin, it returned an error about my SSL certs. After Googling, I found this thread and included the SSL cert in my local php.ini and restarted.

http://stackoverflow.com/questions/6400300/php-curl-https-causing-exception-ssl-certificate-problem-verify-that-the-ca-cer

The error went away, and then it had a problem with the setHeaders(). I commented that out, but the data that comes back from the server is encrypted data, that cannot be parsed. For a workaround during dev, I am temporarily using "file_get_contents", and the data comes back just fine. But I would prefer to leave your module intact, and not use the FGC method for SSL requests.

Any other windows testers out there?

$client = $this->getHttpclient()
                            ->resetParameters(true)
                            //->setHeaders(array('Accept-encoding' => ''))
                            ->setMethod(Request::METHOD_GET)
                            ->setUri($urlProfile);

            //$retVal = $client->send()->getContent();
            $retVal = file_get_contents($urlProfile);

#Gmail login is not working

Hi Silvester,
Thanks for your work.
In past it was working fine but right now there is an error while login with gmail(returns boolean value).has anything changed in google API? or in our module?

access_type for Google

Hello,

First of all, thank you for this great library, I really love its approach and how its written.

I have one issue though: I would like to be able to customize access_type when accessing Google Oauth2. As a matter of fact, I think it would be nice to be able to set values for all custom parameters that Google offers, e.g. access_type, approval_prompt, login_hint, etc. You can see the list here.

I'd be happy to create a pull request for this, but what would be the best way to do it? E.g. create ClientOptions->setUrlParameters(array('access_type' => 'offline', 'approval_prompt' => 'force')), or define setters and getters on \ReverseOAuth2\Client\Google like Google->setAccessType('offline'), or something completely different?

Thanks again,
Dejan

ZfcUser integration

Is anyone interested in ZfcUser integration?

If, why and how ?

Lp. Silvester

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.