realeez Posted September 17, 2013 Share Posted September 17, 2013 Dear Friends, I am using Simple-REST Library for my REST Web service purpose . I need to integrate "OAuth2" with my REST API skeleton. I attached the REST - API Client & Server for your reference . Please check it and help me with a good solution for implementation. Thanks, Anes simple_rest_client.zip simple_rest_master.zip Quote Link to comment https://forums.phpfreaks.com/topic/282215-how-to-integrate-oauth2-authentication-to-rest-api-library/ Share on other sites More sharing options...
trq Posted September 17, 2013 Share Posted September 17, 2013 Thats not how this works. How about you tell us specifically what your issue is. And we'll see if we can help. Quote Link to comment https://forums.phpfreaks.com/topic/282215-how-to-integrate-oauth2-authentication-to-rest-api-library/#findComment-1449843 Share on other sites More sharing options...
realeez Posted September 18, 2013 Author Share Posted September 18, 2013 Dear trq, My issue is How the OAuth2.0 authentication can apply to a REST API Web Service. I attached the basic implementation of REST API. The code of attached "simple_rest_client->index.php" as follows: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://localhost/simple_rest_master/test"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array( 'username' => 'foo', 'password' => 'bar' ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $contents = curl_exec($ch); curl_close($ch); echo $contents; ?> Here the client call the Controller method "Test" as in cURL http://localhost/simple_rest_master/test. It's URL in localhost is : http://localhost/simple_rest_client/ I also add the code of "Server" in zip file "simple_rest_master.zip". In this case I need to implement the authentication using OAuth2.0 . I looked the RFC standard for it here : http://tools.ietf.org/html/rfc6749 Please help, Thanks, Anes Quote Link to comment https://forums.phpfreaks.com/topic/282215-how-to-integrate-oauth2-authentication-to-rest-api-library/#findComment-1449985 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.