Dynamics 365 Portal/ powerapps portal Authentication with with Google Account

Follow my blog for more interesting topics on Dynamics 365, Portals and Power Platform. For training and consulting, write to us at info@xrmforyou.com
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/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)

3 thoughts on “Dynamics 365 Portal/ powerapps portal Authentication with with Google Account”

Comments are closed.