user793891
user793891

Reputation:

Azure AD B2C + App Service + Functions : How to flow the auth?

I have a Web App (VueJS + ASP .NET Core backend) hosted on Azure App Service and I use Azure AD B2C for authentication. I also have a Functions App that I want to call from the client code but I’m not sure what’s the best way to flow the auth to the Functions.

Upvotes: 0

Views: 1097

Answers (2)

user9035756
user9035756

Reputation: 21

You can handle Azure B2C validation the same way I did here Github

There are several problems to handle: 1. Load token from valid b2c policy 2. Validate it depending on rules set. 3. Setup Validation on Startup/Attribute in order not to create boilerplate code. 4. Currently AF 2.0 does not support invocation short circuits, so you need to properly handle your 401 codes.

Upvotes: 1

Ramakrishna
Ramakrishna

Reputation: 5038

If Easy Auth didn't work for you, there is a workaround and yes it is a manual task.

  1. Send B2C token in header while calling Azure Function
  2. Read the token at the function level and validate the JWT token.
  3. You can easily validate JWT token by decoding/ writing simple code
  4. Check Validate JWT SO post

This manual validation also secure and safe to use.

Upvotes: 1

Related Questions