intelequia/dnn.azureadb2cprovider

How to create a claim for portalId?

Closed this issue · 4 comments

By default, there is no claim for portalid.

I can edit a custom attribute portalid/int as part of a workflow, but then it is asking my users for the portalid during sign up.
Now the login will fail with

The user has no portalId claim and portalId profile mapping is setup. The B2C user can't login to any portal until the portalId attribute has been setup for the user. Ensure that the PortalId claim has been setup and included on the policy being used.

Within user mappings, I can set the B2C claim to an empty string for PortalId, afterwards a signin is possible.

My question is how to setup a claim for portalId without asking my users to enter it.

DNN: 9.4.4
Provider: 1.2.0

Hi @SCullman,

The currently supported scenarios are:

  1. All B2C users can login and signup in a single portal installation: the portalId claim should be "empty" on the profile mapping (no portalId extension is needed and all the B2C users can signup and login into DNN)
  2. B2C users can login in a multiple portal installation (no signup): the portalId claim should be set to the attribute extension name (i.e. portalId). Note that the users should be pre-provisioned by setting the portalId extension value, you can do this by using the DNN B2C user management module that already sets that attribute value when creating the users, or by other MS Graph mechanism.
  3. B2C users can login and signup in a multiple portal installation: for this scenario you should have to implement a B2C custom policy to fill up the portalId to the desired one. I haven't worked on this custom policy, but could be implemented by using the "portalId" that is embedded in the "state" property being passed to the SignInSignUp policy. Not easy, but feasible.

On which scenario are you working on?

I am just learning about ID Providers in general and also evaluating the options with Azure AD B2C.
Currently 1. is doing the job.
Maybe the mapping for portalid should be reset to a blank string? That would facilitate first steps for beginners.


@davidjrh , thank you very much for your work. I'm working my way through the examples right now, helps me a lot!

If the portalId mapping is not set to a blank string in the default installation, was not intended. I will review it.

Oh yeah, I see the default value set to "portalId", while should be empty.

ec6cd6c