oAuth2 php Server Library: how to integrate it? - php

I'm trying to integrate oAuth2 in my website. I'm using the library of bShaffer on GitHub: https://github.com/bshaffer/oauth2-server-php
I've seen some screencasts about how oAuth2 works and so on, so I know enough things. But what I don't really understand is: how do I pass the username/email or other data about the user?
I mean: my website will be the identity provider and I need to authenticate the user to another website. Now, when the user logs in, how do I pass its username or something other?
I don't find anything about how to pass data in the oAuth2 Server php documentation. Just found something about how do I pass the userID, but nothing more. Am I missing something?
Thanks.

Related

facebook login implementation in joomla 3.0 site

I am implementing Facebook login into joomla login module. I tool code from Facebook sdk site and I am able to authenticate using facebook. After authentication I am getting user data also like username and email id.
Now, Problem is it is not logging-in into my joomla site using this information? I am using this information to create an user with random password.
If I can get any reference of any tutorial where facebook login is implemented. That will be really helpful.
Please let me know if you want any specific piece of code.
I don't want to go for any extension because I have few other changes also, in the same module.
That's not surprising considering the Facebook SDK is not concerned with interacting with other websites, especially since there are so many different website platforms.
I know it's not the answer you want, but I honestly think you're going to have to use a 3rd party extension. The good news is that there are plenty of them that will create a Facebook/website authentication plugin.
I suggest starting here

Endomondo API using oAuth

I'm building a web app which I would like to connect to Endomondo to retrieve the workouts.
I've seen some web applications doing this using what seems to be oAuth, however, I don't seem to be able to find the API documentation in the Endomondo site, what's more, the PHP libraries I've found on Github seem to require the Endomondo username and password, which doesn't seem to be the best option.
Does anyone know where can I get the documentation or at least some information about this API? I'm interested in the oAuth option if there's one, as I'd rather not ask for the username and password.
there is no opened official API or documentation from Endomondo team, and I didn't find any Oauth php lib.
But perhaps you can try get the Oauth info from this python lib to sync activities -> https://github.com/cpfair/tapiriik/blob/master/tapiriik/services/Endomondo/endomondo.py
Good luck.

oAuth 2.0 users vs clients?

I am implementing https://github.com/bshaffer/oauth2-server-php which is a library for PHP with oAuth 2.0. My question however is as part of the installation their are two tables that are confusing me. One is user_table and the other is client_table. The way it works though is it uses the credentials from the client table to generate a key. So what im wondering is what's the purpose of the user_table?
I already have an existing table for my users and I wanted to authenticate using the username and passwords in there so I was wondering how I go about doing that. Thanks for any help and I am just trying to wrap my head around the purpose of the user table especially since I don't see any use of it on the github example.
That seems to be a framework for building an "OAuth2 Authorization Server". Assuming your app has "resources" that need protection (via an API), users of your app are the "Resource Owners". "Clients" on the other hand, are "clients of your API" (often 3rd party apps), that your users would want to give access to.
OAuth is in essence a resource access delegation system: user X from your app, gives app Y access (through an API) to resource Z managed in your app and owned by X.
If all you want is to authenticate external users to your app, that is: outsourcing authentication to someone else (e.g. LinkedIN, Twitter, etc), you are probably looking at the wrong fwk.

Create own oAuth process in Codeigniter?

I am developing an API using Codeigniter and Phils RESTserver.
I need to have authentication working with oAuth but I cannot find a library
that works with both Codeigniter and MongoDB.
Is it simple to create the oAuth process myself? I know it is hard to answer
not knowing my level of expertise.
This is my understanding of the oAuth process.
User clicks on link and are redirected to the servers login form.
User will be asked to authorize the developers app.
If he does authorize it he is redirected back to the developers website.
On this website the code that he got from step 3 will be exchanged for an access token.
Developers app will now be able to access the users account on the server.
I know there are parameters to be sent along with the requests like client_id and client_secret and redirect URL. But my question is. Is it this easy to implement an oAuth server? Just create the classes and functions? What else are the requirements to
be able to call the process a true oAuth authentication?
Thankful for all input!
Have you had a play with this?
https://github.com/alexbilbie/CodeIgniter-OAuth-2.0-Server
Alex has also written a Mongo library, so if his server doesn't support Mongo out of the box then just have a play with that. Just because your API is in Mongo though doesn't mean the api keys, tokens, etc HAVE to be in Mongo too, but they easily can be.

Single login, multiple application authentication

Is there a Codeigniter authentication server that's available for use? Trying to get a multi-application service going similar to Basecamp and I don't want to reinvent the wheel. Alternatively, are there any respectable resources that deal with this kind of authentication?
Thanks!
You should be able to create a user db, and authentication library to do the job.
TankAuth maybe?
You can have 2 applications either seperately installed, or sharing a CI installation using the same library and authentication database. I'd keep everything else application specific, just share profile and login information.
Or, you can implement an OpenID service and have all of your CI applications connect via openid. This is the way StackOverflow does it. I'd google "codeigniter openid" to see what's available. here's a sampling:
http://thinkmoult.com/2009/02/22/use-codeigniter-openid-library-to-integrate-openid/
http://codeigniter.com/wiki/OpenID
Facebook connect offers good authentication possibilities. Also Google, Yahoo! and many other big sites offers similar posibilities.
If you mean that you want some form of 'register at one site get them all'-service, all you need to do is point the authentication to the same database on all sites.
Another posibility is making an authentication page then using cURL or AJAX to check authentication.

Categories