How Login Works in D365 Portal
Why Portal is best Choice?
It give your users a simple view of Portal or their business data.
Also because it saves your money for licensing cost.
For E.G
You have user base of lets says 1000 users, you purchased the license for each user and each user login in to CRM just to Create/view/Edit or delete some entities record.
So, When you have portal, Why to create so many user account and then assign license to each one and paying for them.
What we can do is we create contact for each of those users and allow access to specific entity they are interested in and allow functions they are suppose to do.
and you licensed are saved and so do money
First thing CRM Portal is accessible to public by default (unless you restrict by IP address.)
If you share link to anyone, they can see couple of pages and Sign In Page.


This page has User name and password but where to get this User name and password?
also if you notice there is an option to sign in using external account, so what is internal/External account.
Dynamics 365 Portal user can have 2 Type of account.
Local Account and External Account.
Local Account – A user whose control is within CRM is a local account, Here login process has nothing to do with third party application to allow user login in to portal.
Users can be in two Entity of CRM.
Entity 1: user (The Actual CRM licence Users)
Entity 2: contact (The Record of contact entity), You don’t have to create and assign license for allowing your users to access portal .
This is the Key benefit of Portal. you can access CRM data, view CRM data, Create/Update/Delete CRM data even without Creating license.
External Account – Now you may have your AD, Facebook, Gmail, yahoo, Twitter account but this is not CRM account so this are treated as External account, but when you register using any of those account, a contact record is created for the same, so that you can control access to portal records
You can configure this external accounts with other domains and type.
Check this Link for more Details.
You will not see button to login via Facebook, Gmail twitter on registration page or login page by default, This is because you have to provide each app (APP ID) which you get from developers portal of each webapp.
For E.G. Facebook have developer page and once you link your portal there you will get App ID.
Local Registration – If you have CRM access and you want to login using that access you can click register

If you click Azure AD, it will ask you for permission to access portal, Say yes to allow portal to user your AD account.
What happen behind the scene is, it will create contact for your AD account.
So to make it simple to understand, contact is the base of all the accounts of portal.
Now Lets Create another account by providing information on registration page and not using AD.

Once you click Register it will redirect you to profile page same for AD registration and all other registration.
Also notice contact will be created in CRM contact entity.

You will see Full Name as Empty, you can either update in CRM but as a user of portal you may not have access to CRM, so you can update from Portal as well, on profile page and it will be reflected in CRM contact record.

Click update and check in CRM.
Now this was the case when you have new users for portal what if you want to give access to those user who are already in CRM.
Lets say you have customers and they are asking for some easy and straight forward portal to access their Data and so manipulate it in simple way.
CRM is a business application and not everyone want to get into it and learn it.
Create contact record for each users/customers or open any existing contact record to whom you want to give access to.

Click Create Invitation, obviously you are not going to click for each and every contact so you can automate this process as well by writing some workflow or plugin.
You can write workflow for all the contacts and create invitation for each contact.
For this contact we will click “Create Invitation” it will take you to Portal Invitation entity form.

Check out the invitation code is empty before creating, now click save and check the same field, you will get an invitation code for this contact.

This Code you can share via Email or there a Workflow which send invitation to current user if email id is valid and Email is configured.
I have not configured Email, so wont be able to send invitation but you can give a try.
What to do with this invitation code?
Once you pass this invitation code to any contact user via email or anything.
User will have to go to this portal home page, click sign In and go to Redeem Invitation tab and paste the Invitation code they got.

Click Register and you will be presented with Registration page.
But it wont create new contact for you, it will bind you information with invitation code contact.
This is how you can login in to Portal with different options.
Portal is for new users as well as for users who are already in system.
Portal is for Azure users as well social networking sites accounts.
In Portal it all end up to contact record,
If you come to register from any location contact will be created and if your contact is already in CRM then using invitation code you can register to Portal.
Why everything is ended to contact?
1. Contact is just a CRM record where you dont need license and managing subscription.
2. Contact is associated with Portal Web roles, so you can allow specific contact with specific privileges to manipulate or edit portal.
Now as we know how to create portal, configure portal, Register and login into portal.
upcoming blogs we will see,
How to allow access to contact using web role.
How contact user can also make changes to portal using content editor?
How to give access to specific Entity and view its record to specific user?
and so on….
There is lot more thing is portal
stay tuned….
*This post is locked for comments