-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed changes for the API to work with Facebook OAuth v2. Instruction... #1
Conversation
…ions on 'CakePHP-Api-Datasources' project
Were you using this in conjunction with the Apis plugin? And if so, were you able to put together a Facebook Api plugin? Been meaning to do this for a little while now. |
I'm poking around your forks and reviewing some of the OAuth spec. I'm curious, have you taken a look at this plugin? https://github.com/ProLoser/CakePHP-Github It's done using OAuth v2. I'm wondering if I implemented it incorrectly or if you just didn't know about it. |
Hi Dean, and thanks for the quick reply. I didn't see Github example. It would've saved me a few hours... 1- Requests were using http -> I put on the method map 'scheme' => 'https' and it worked (I saw you put it on beforeRequest() ). Also 'version' => '2.0' was needed. 2- I found 3 different urls when normally there are 2, that's why I had to create 'oauth_acess_token' and use it on getOAuthAccessTokenV2() : authorization -> **https://www.facebook.com/dialog/**oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL 3 - This same request (getOAuthAccessTokenV2) was failing because a 'redirect_uri' param was missing. I put one and still not working. This Stackoverflow article saved me, it needs to be exactly the same URL than previous request 4- And finally I got this error response and I had to extract from OAuth 2.0 draft doc that only "OAuth access_token" was necessary on "Authentication" HTTP param. Maybe other params are allowed, but you're the expert on that. I found your plugins amazingly useful, but maybe a little more documentation or examples would have helped a lot. For example I'm not sure how to use the 'method maps' or 'schemes' on my behalf. You're free of using this info I gave you and enhance the code to upload a Facebook plugin. I hope I could help. Thanks |
So you my Github code doesn't work for facebook? Then my next test would be to ensure your facebook code works for Github, and finally to decide the best way to abstract the 2 solutions (as I'm not entirely sure requiring people to override the constructor is a great idea). As for the map, that part is what makes the whole plugin FAKKING AWESOME and you need to do it. I would actually recommend you creating that Facebook plugin you outlined (although I'll try walking through your instructions and doing it too) instead of just documenting it. As for the map, the way it works is thus:
That's it! Hopefully this crappy short explanation isn't too confusing, but look at some existing plugins for reference. I would have given some applicable Facebook url examples but their api seems to be fairly.... static. Almost everything appears to use 1 end-point, and the only parameter you really NEED to pass is the id of whatever it is you're looking at. There is almost no need for sections. |
Proposed changes for the API to work with Facebook OAuth v2. Instruction...
...s on 'CakePHP-Api-Datasources' project