Map B2C user to customer-object

Jtuc 1 Reputation point
2022-06-13T13:03:07.967+00:00

Hi
Im about to build a webshop. The webshop uses Azure B2C.
So when a customer login i get a token back with a object-id fra B2C.
Then im able to use httpcontext.User etc..
I have a Customer.cs with all the information needed about the customer.
What is the best way to combine the logged in user with the customer-object?
Do i need to get the GetCustomerByB2cId(objectId) every time i need to do something?
Or is there any smarter way to do it?

Best Regards

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
931 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,467 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 21,621 Reputation points Microsoft Employee
    2022-06-13T22:25:01.487+00:00

    Hi @Jtuc , thanks for the question. Are you storing user attributes? That's usually the easiest way to reference them. You could also use the Graph API. Please let me know if you've looked into these. Please let me know if you have any questions or if I misunderstood the question.

    Thank you,
    James

    0 comments No comments