Posts

Showing posts with the label Oauth

Access User Profile API via Google OAuth 2.0 Playground ?

Image
The OAuth Playground is an application/tool by Google for learning how OAuth works. It presents you with a three-step process for selecting the services you want to authorize, generating an access token, and making API requests. In OAuth terminologies, Google OAuth playground will act as a client Application which does contain client id, Client secret and OAuth Endpoints required to access Service provider. It also supports custom endpoints as well i.e. using Google OAuth playground you can connect to another service provider as well apart from Google like Salesforce. Resource Owner:  You Client Application:  Google OAuth 2.0 Playground Service Provider:  Google In this blog, I’ll only focus on Google API and will try to retrieve user profile via playground. Step 1: Hit https://developers.google.com/oauthplayground/ Step 2: You will see a list of scope using which you can access particular resources. As our aim is to fetch user profile so will...

Registering an Application with Facebook

Image
This guide walks you through the steps of registering an application to integrate with Facebook. Register a new application From  http://developer.facebook.com , click on "My Apps" at the top of the page to go to the application dashboard. The dashboard shows a list of applications that the developer has already created or you can create a new one by clicking on  Add a new App.   A dialog prompts you to name your application. Enter Display Name, Contact Email and Choose a category from drop down list and click on  Create App ID . After you click, Facebook performs a Captcha check to verify that you’re not setting up applications through an automated process. Once you’ve satisfied the verification process, your application is created. The next page you see is your application’s application page. Click on the  Settings  button and it will open you a setting page of your application. Now we can configure various det...

OAuth vs SSO: Which One Should I Use?

Image
Currently, I am working on one project which provided me a lot of opportunities to learn about OAuth 2.0 and SAML and better understanding on which one to choose for SSO strategy. I am choosing this topic because most of the people get confused between these two. While they have some similarities but they are very different too and to put it one line. I would say “OAuth is not Single Sign-On” What is the difference between OAuth 2.0 and SSO? OAuth (Open Authorization) is a standard for authorization of resources. It does not deal with authentication. It allows secure authorization in a simple and standard method from web, mobile and desktop applications. If you try to log into Stack Overflow using Facebook, you’ll be redirected to Facebook’s website and will see something like the following: Once authenticated with Facebook, it will ask for Stack Overflow’s permission to access your resources l ike your name, Email id, Profile picture and so on. This is an authoriz...

Working of WSO2 Identity Server

Image
To enable OAuth support for your client application, First we need to register our application on WSO2 Identity Server. Step to register Client App on WSO2 IS : Goto Management Console and Enter your username and password. By default its “admin”. Click Main button and then OAuth in Manage menu. Click on the Register New Application link on the OAuth Management page. Select OAuth 2.0 as the OAuth Version . Enter Application Name and your Callback Url . For this app to work use http://localhost:8080/playground/oauth2client .       5. Click on Add button , you will see your application under the OAuth                Management Page. Click on the WSO2 application and copy the Client ID, Client Secret, Access Token URL and Authorize URL. We need these values for our web app. You are done with the registration part..!!! Sample App wi...

How to retrieve Facebook profile using Apache Oltu

Image
This tutorial shows you the basic of OAuth using Apache Oltu (Formely known as Apache Amber). We have created a Java Web Application that authenticates the user to Facebook via OAuth 2.0 and retreive the protected resources from Facebook. Setup : SSL enabled Tomcat Server as we have deployed our Web Application on tomcat. Click here for instruction on How to enable SSL on Apache Tomcat 7.0 Registered Facebook Application. Check here for instruction on How to register App on Facebook. Download the OltuClientFB Application from the GIT repository. If you are using Maven then add below dependency or download Apache Oltu client jars : <dependency> <groupId>org.apache.oltu.oauth2</groupId> <artifactId>org.apache.oltu.oauth2.client</artifactId> </dependency> Run the Project : Check out the project from the above URL, import into the eclipse and Run as a Server. Navigate your browser to https:...

How to register App on Facebook

Image
Steps to create Apps on Facebook : Login to your Facebook account and then Goto https://developers.facebook.com/ and then click on Apps tab. Check below screenshot : Registration Page Enter the Display Name. This is required.  Enter Namespace. (Optional) Choose a Category and then click on Create App button. After verifying captcha It will show you the App ID and App Secret which is nothing but ClientId and ClientSecret . Check below screenshot : Select “Settings” and then click on “Advance” tab. Scroll down and enter your callback URL in “Valid Oauth redirect URIs” and then click on “Save Changes button to save your apps. Congratulation!!! You have created your Apps on Facebook.

How to integrate Web Application with Salesforce via Oauth

Image
This tutorial shows you the basic of Oauth. We have created a Java Web Application that authenticates the user to salesforce via Oauth 2.0 and then we have performed few CRUD operation via the new API. Setup: SSL enabled Tomcat Server as we have deployed our Web Application on tomcat. Click here for instruction on How to enable SSL on apache Tomcat 7.0 Salesforce Remote Access Application. Click here for instruction on How to create Remote Access Application on Salesforce? Download the application from here and change the name to Services. Run the Project: Check out the project from the above URL, import into the eclipse and Run as a Server. Navigate your browser to https://localhost:8443/Services . You will see the following page: Click on the link and it will take you the salesforce page for Authentication : Once you are login into salesforce, It will ask you to allow the Oauth_Apps to access your data: ...

How to create Remote Access Application on Salesforce?

Image
Before I'll start with how to create Remote Access Application. First let me explain what is actually Remote Access Application. What is Remote Access Application? A remote access Application is an application external to salesforce that uses the Oauth protocol to verify both the salesforce user and the external data. All remote access applications have been integrated with salesforce, such that they can access a subset of your salesforce data once you explicitly grant each application permission. How to create Remote Access Application? To create an Remote application, You must have your developer account, If you don’t have it then You can create it from here . Step to create your First Remote Access Application: Login to salesforce.com then click Your Name |Create | Apps and click on “new” button. Check below screenshot :     When you click on new button, you will see a page like this: Enter the name of the Application. This i...