I have two cakePHP apps on 2 different servers. One app is required to get data from the first one; I have succeeded to put the Restful architecture in place but I failed to implement an authentication procedure to the requests the server sends. I need to authenticate to secure the data. I have looked around on the web but can't seem to get it working. Can anyone point me to a resource / tutorial that explains this in detail. What I would ultimately need would be a way to authenticate my server every time it sends a request to the other server. Any help would be appreciated.
Authenticate Restful cakePHP 2.3
1.3k Views Asked by elha At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in CAKEPHP
- Moving a CakePHP 1.3.2 Application to a New Server
- Different cakephp datasource for local and live
- How to call a model function insider another controller in cakephp
- how to display a message if database table is empty in cakephp
- cakephp 2.x multiple models(included optional) validation
- MongoDB configuration in CakePHP 3.x
- cakephp 2.x how to set empty model to valid(multiple models on same page)
- Get last inserted ID after inserting to associated table
- Cakephp Find all WHERE in two categories
- Alternative for PDO in cakephp
- cakephp 3 and view cells with use of Cookie
- issue Login cakephp
- calculate the Sum of note pupils in class
- Linking Models Together hasMany cakephp
- Saving Data form in CakePHP
Related Questions in CAKEPHP-2.3
- how to display a message if database table is empty in cakephp
- Cakephp Find all WHERE in two categories
- Cakephp link to view a page in sub folder
- CakePHP HABTM Select box in edit mode not populating
- view($id) Method is being called instead of index() Method with GET VERB [CakePHP]
- CakePHP deep (multiple related models) validation?
- PHP Sort Varchar Data Array In Ascending Order
- Why we use escape => false in cakephp
- Delete multiple rows by ticking Checkbox
- Separating admin login & member login in CakePHP ACL
- Cakephp After delete all
- CakePHP AuthComponent not ridirecting properly on Chrome
- cakephp binding model through another table
- $this->Html->css with inline=false doesn't work
- CakePHP flash messages not getting removed from session
Related Questions in RESTFUL-AUTHENTICATION
- ServiceStack Authenticates both iOS Apps when one is logged in
- Build and use Cookie for token based authentication to gain access to api through openAM
- How to protect a Web API using ASP.NET 5 MVC 6
- how to connect android to restful api
- Passing values from HTML to python using EVE rest framework
- SecurityConfig Java file error
- How to return Array of two JSON Object in Jersey RESTFul API(JAX-RS)
- Spring boot security password not printed
- RESTful windows authentication
- How exatly works JWT token security management using REST API?
- Rails 3 using OmniAuth Unknown Attribute Error
- Flask RESTful Destroy User Token
- AtTask API Login Error
- jax-rs only authentication no authorization
- JDBCRealm authentication works with Servlet @WebFilter but throws NamingEcception when using security constraint in web.xml
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I finally got it to work after some research; indeed one of the solutions is OAuth. In case you are facing the same problem, I can advise you this Plugin made for CakePHP. In details what I did was put the OAuth Plugin into my API Server and I used it like so for my restful controller:
The function RestObject.token() is what I would call to get an Access token which will be used to give me access to the Resources in my controller. (Note that by declaring OAuth in my controller components, all the resources within my controller will need an access token to be accessible). So on the client Server I would get an access token in the following way:
This assumes that you have clients already set up as explained in the Plugin Doc (replace xxxx by the real values for the client credentials). Once I have my access token, all I have to do is use it as follows:
And here you have it! So start by reading the Oauth Specification to understand the Protocol (in particular the Obtaining Authorization part), see which protocol (can be different from the one I used) applies and adapt to your case by using the Plugin
Tutorial Here