1

I have developed REST web service api in PHP and now I would like to secure it using OAuth 2.0. Basically I would like to provide token based access to the user who is accessing the web service api.

My application will be signed using Open Ids (Facebook, Twitter & Google+), I will get basic details like consumer_secret and ids from the open ids.

I have few queries :-

1) Do I need to create tables in my MySQL database and create token and store it with timestamp? And then whenever any user calls the api, we first check the token is valid or not and after that grant access to api.

1 Answer 1

2

Yes you will need to do that, but implement a OAuth server is a lot of work, better choose an existing package like https://github.com/bshaffer/oauth2-server-php or http://oauth2.thephpleague.com/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.