Posts Tagged Twitter
Hacking Social Networks APIs… the MovieIT way
Javascript based Facebook login OAuth 2.0
One of the positive features of OAuth 2.0 is that the OAuth dance occurs only by using HTTP GET method. This code resides in the Auth.htm page. The if structure checks the browser URL to identify the current step and move to the next one. The first step is to access the https://www.facebook.com/dialog/oauth by providing the application id, the redirection URI and the response type (which in our case is of type token). In our case we set the redirection address to again to the Auth.htm file. After the successful redirection from the Facebook page the script makes again a HTTP GET request to the same endpoint by providing the application ID, redirect URL, the response type and the resources that this application will have access to. If everything goes well then Facebook redirects the browser to back to the Auth.htm page by providing a code parameter. The final part of the script extracts this information for the url and passes it to our servlet in order to provide a customized to the user homepage (e.g. his profile image etc.). Read the rest of this entry »