user4266661
user4266661

Reputation:

Authentication vs Authorization?

I'm new to Azure ADB2C, and am confused by some of the terminology.

I am building a motorcycle ride monitoring website that I would like users to be able to log in to by verifying a social media identity (Google & Microsoft Account, for now).

But I only want users who are members of the site to be able to use certain features. For example, I'd like everyone who authenticates to be able to apply for membership, read about the benefits of membership, etc., but I only want members to be able to initiate ride monitoring.

Is the recommended approach here to only authorize (rather than authenticate, if I'm understanding the terminology correctly) certain authenticated users (i.e., members) to use the ride monitoring services?

If so, what's the best way to authorize a member? Look up their email (which I require to be returned from the authentication process) in a standalone database and proceed accordingly? If I go that way, what's the simplest way of adding their membership status to their credential, so I can access it throughout the site?

Apologies for not providing code here. I've got a bit of it hanging around :) but this is more of a design question than a coding one.

Upvotes: 2

Views: 1860

Answers (1)

Abhishek Agrawal
Abhishek Agrawal

Reputation: 2287

Azure AD B2C is primarily Authentication as a Service. There are ways in which it can be used for what you are trying to achieve here.

  1. You can use custom (extension) attributes in AADB2C (https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-custom-attr) in combination with AAD Graph apis (https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet). So when user authenticates and applies for membership, you can call AAD graph api to set the custom attribute on user object. You can get the extension attribute in a the token after the authentication happens. This token will give you membership of the user.

  2. You can also use AAD Groups instead of custom attributes. In the tenant, create membership groups. Once user authenticates, call AADGraph to set/get user's membership of a group and that will give the authorization information.

  3. You can also do what you described, maintaining the info in a database store of your application. But the first two functionalities provide in-built functionalities for user management.

Upvotes: 2

Related Questions