Saturday, May 7, 2016

Log in/Sign in Liferay with Google Account


In most of the websites you see that their is a option by which you can login with your Google+ credentials. Today we will achieve this Login Functionality with Google in our Liferay. This consists of two Major Steps.

1)Set up Google+  OAuth2 API Access
2)Integrate this App with Liferay.

So lets start step by step:-

A)Set up Google+ OAuth2 API Access

Go to Google Developer Console by clicking here . And login with your Gmail credentials.Now Click on Select a Project and then create new project



Now provide your project name and Click Create.



Now Click Credentials and click on Create Credentials



After that select OAuth ClientId


Now Click on Configure Consent Screen




And Provide Product name this can be anything and Click save



Now again go to credentials-->Create Credentials-->OAuth Client ID .Now you can select Web application and provide the following values:-

1)Authorized JavaScript origins

http://localhost:8080

2)Authorized Redirect URIs

http://localhost:8080/c/portal/google_login?cmd=token



And Click Save.A new window is open with Client ID and Client Secret.




 Copy the both values to notepad.

B)Integrate with Liferay

Go to Market place and download Google Login App by Sergio Gonzalez . You will get a .lpkg file put in deploy folder of tomcat.

After that login your portal with admin and go to control panel--> portal setting-->Authentication. Here you see a new tab google click on that and provide Client ID and Client Secret



Go down the page and click save



Check Output

Logout from Admin and click on Sign In Button you will see a new icon click on Google and provide Gmail Credentials . That's it you are successfully login with Google






Hope this will Help....






Related Post:-

No comments:

Post a Comment

Total Pageviews

Number Of Unique Visitor

Free counters!