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 th开发者_运维知识库e 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.
精彩评论