(Dynamics 365 + ADX) Portal Authentication with External Identities Part-II – Authentication with Google Account

In my previous blog, I have explained on how to authenticate your Dynamics 365 portals with Azure Active Directory. You can read it here – https://debajmecrm.com/2017/06/12/dynamics-365-portal-authentication-with-external-identities-part-i-authentication-with-azure-active-directory/

However these days it’s common to come across websites which have options to sign-in with Google and Facebook.

Why are lovely portals be behind in this. And in case you are unaware, D365 portals has the support to configure this kind of authentication with Google and Facebook in a very simple way. So let’s explore on how to do this.

 

Step 1: Register your portal with Google API’s

 

Go to Google API Console – https://console.developers.google.com/projectselector/apis/library

Click on Credentials

image

 

In Create Credentials dropdown, Click on OAuth Client.

image

 

In the screen that comes up, Enter the below details

image

 

Name – This can be anything you want. I have named it as Microsoft portal identifier.

Authorized Javascript origins –  This is basically your D365 portal URL from where the request would originate.

Authorised redirect URIs – This is basically the call back URL once the validation is successful. As you can see I have entered https://xrmtr1.microsoftcrmportals.com/oauth2callback

Click on Save.

Once saved, you could see your client_id and client_secret. We do not need the client secret here. Just keep a note of the client id.

image

 

Step 2: Modify the Site Settings in Dynamics CRM

 

Go to CRM-> Portals-> Site Settings.

We need to create three site settings records here.

The first record would be identify the Authority URI from where we need to get the token.

image

I have put the  name as – Authentication/OpenIdConnect/Google Sign In/Authority. The part in bold is basically the name of the button as you want to show up in the login screen.

 

Second record of Site settings is to capture the value of the Client ID registered with the Google API’s

image

 

The third record is to capture the value of the redirect URI. This is the same value that you should put while registering D365 portal in Google API in Step 1.

image

 

And you are done.

Now when you try to register in your CRM portal, you could see the magical ‘Google Sign In’ button. Whooo. it was so complex Smile

image

Any body with a Google account can now register with your portal.

image

image

 

You would be asked for consent as per OAuth 2.0 protocol.

image

 

Once you provide your email and click on ‘Register’ you are done.

image

 

So simple and yet so powerful extensibility for your portals.

 

Hope you liked this post.

 

-Debajit Dutta (Dynamics MVP)

For Training and consulting please visit www.xrmforyou.com

(Visit our products page – http://www.xrmforyou.com/products-1.html to know more about our offerings)

Advertisements

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 10 years of experience in Microsoft .NET Technologies and 7 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

3 thoughts on “(Dynamics 365 + ADX) Portal Authentication with External Identities Part-II – Authentication with Google Account”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s