Ravi Solanki
Ravi Solanki

Reputation: 87

API APP + Authentication with AAD and Facebook + AllowAnonymous

I have created a API app in Azure portal. Then after I have configured Azure Active Directory and Facebook for Authentication/Authorization in Azure Portal (Portal -> My API APP -> Authentication / Authorization). Now my requirement is some API should be Allow Anonymous and other APIs should ask for Authentication either from Azure Active Directory or Facebook.

Same issues like my case: Question-1 Question-2

Please help !!

Upvotes: 0

Views: 130

Answers (1)

Alex Belotserkovskiy
Alex Belotserkovskiy

Reputation: 4062

I think, your solution may benefit from using other authentication broker service called Azure Active Directory B2C. Basically, you configure the providers you want on the backend side, then integrate it into your application. Then, you are able to use mechanisms like policies, etc, in your app. For WebApp integration with AD B2C - tutorial. I would do that in your situation because i believe that it would be better to offload authentication boilerplating to the backend instead of doing a lot of custom things in the application.

Other way of doing that would be to use custom attribute that will add the capabilities to authenticate, cache user information, authentication context (regarding your question about how to detect if someone is logged in) etc.

Upvotes: 1

Related Questions