December 15, 2016

Social connect module for DXA - Part 1

 recently published Social Connect module for Digital Experience Accelerator. which extends Dxa to login using social network.

Currently this module supports two social networks
  • Facebook
  • Google Plus
but i will try to add Twitter and linked-in later.

After installing this module you will find login link on your Dxa menu.
After click on the Login link you should find below option to select.
After clicking on above e.g Facebook. Facebook will ask for Credentials to enter. after successfully validating. Facebook will return back to Dxa application with token and other details in form of claims. 

Custom modules will receive inputs from the Facebook and accordingly update the UI with logged in name and logout link.

Similarly when after clicking on Google, it will take you to Google login and ask for credentials and OTP. and take back to application with claims. claims are processed and use is logged in.

To achieve above there are few settings to be done at Facebook and Google console where return URL etc are returned

Google requires to create credentials at
  • Create Auth 2.0 Client-id
  • Give it a name, 
  • Mention Return URL of your application, which will receive the token after successfully authenticated by Google.
  • for Google default URL will always be http://your-domain/signin-google.

I tried to have other endpoint as well but did not work for me so i kept default Url for my testing.

Similarly for Facebook you have to create new App and provide your site's Domain and URL. it will also redirect on your siteurl on a default page with name: /signin-facebook again Owin automatically intercept this and accordingly validate the token and proceed to next steps.

No comments: