0

I need to build an application where the front-end (ReactJs) is totally decoupled from the back-end, which is built using Asp.Net Core v5 (or higher) Web API.

Users will log in to the application using both OIDC with Azure Active Directory and local database login.

For performance reasons, I'd like to split some APIs into different projects and eventually install them on different servers. I'm wondering if the [authorize] attribute I will put on the endpoints will work as usual even if they are running in different environments.

Please note that they could be different servers or different AWS Lambda functions, but in both cases, they can be considered different executables.

Is it something possible or I'm going in the wrong direction?

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Giox
  • 4,785
  • 8
  • 38
  • 81
  • 2
    It's completely possible (and common), as long as all APIs (and possibly Lambdas, depending on how they're used) authenticate against the same Azure Active Directory instance – Camilo Terevinto Oct 04 '21 at 09:11
  • @CamiloTerevinto thanks for the reply. Yes, sure it will be the same AAD instance. And what about the local login using aps.net identity? It should work without issue too, right? – Giox Oct 04 '21 at 09:17
  • 2
    Yes, you can set up ASP.NET Core Identity with both local login and AAD without issues :) Just ensure that your tokens always have the necessary scopes (to call other APIs in your system) – Camilo Terevinto Oct 04 '21 at 09:20

1 Answers1

-1

Please note that they could be different servers or different AWS Lambda functions, but in both cases, they can be considered different executables.

Is it something possible or I'm going in the wrong direction?

Thank you @ Camilo Terevinto, Posting your suggestion as an answer to help other community members .

"It's completely possible (and common), as long as all APIs (and possibly Lambdas, depending on how they're used) authenticate against the same Azure Active Directory instance.

And we can set up ASP. NET Core Identity with both local login and AAD without any issues . Just ensure that our tokens always have the necessary scopes (to call other APIs in our system)"

For more information please refer the below links:

SO THREAD : How to use both Azure AD authentication and Identity on ASP.NET Core

Blog: Token Based Authentication using ASP. NET Web API 2, Owin, and Identity

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15
  • Please stop taking peoples' comments and turning them into answers. This is plagiarism. And you've done this with several other questions. If someone left a comment, that means maybe they thought it wasn't enough to be an answer, or it was just a suggestion. Next time, encourage them to post as a proper answer if it is indeed an answer. But taking someone else's content for answers (repeatedly) is not the way to go. – David Makogon Nov 06 '21 at 02:48