Simple PHP REST server with secure user authentica

2019-06-18 07:14发布

问题:

I'm looking into writing an PHP REST API that would allow registered users interact with the web service from third party applications.

What I need the API to be able to do is:

  • provide support for secure user authentication
  • allow registered users to interact with the service from 3rd party applications
  • this applications should be registered and approved on the system beforehand (similar to twitter)

I was wondering what would be a good framework or library to start from that provides a good basis for such a service.

titel

回答1:

Sounds like an OAuthProvider would do what you describe. Here are some tutorials on how to make an OAuthProvider using PHP's OAuth module.

http://toys.lerdorf.com/archives/55-Writing-an-OAuth-Provider-Service.html

http://djpate.com/2011/01/13/how-to-write-a-complete-oauth-provider-in-php5/



回答2:

You could try one of the OAuth libraries for PHP listed on http://oauth.net/code