Create local Identity User after external login (AAD) from angular
I already have the AAD login success, put the token in http request (via local storage access_token) and everything works fine. The problem is that when AAD is used, no local identity is created and it passes the [Authorized] but I doesnt have any user permissions, so I need to create and "assign" to the local user.
Adds the authentication (api):
Adds the AAD prompt (angular):
When obtained the token, set to local storage and it uses automatically in requests headers (that's why Authorized is passed ok):

I already checked #2815 but that uses .cshtml pages
It seems that it only needs the access_token in localStorage and it is not validating anything in backend (removed the AddAzureAd or AddAzureADBearer and behaviour is the same)
Someone has this already working?
Hello @luisp88,
Did you solve the problem? If not, can you give me more information about your project structure? (tiered etc)
@gterdem thanks for your concern.
I'm using abp template: EFCore angular, all backend projects in same solution (identityserver is in the same backend project).
My angular project (using import { MsalGuard } from '@azure/msal-angular';) redirect to MS login and authenticate the user in its tenant OK, but the backend isn't authenticating the calls
Localstorage after MS Login:
Http requests is sending bearer in header:
But api logs shows:
AuthenticationScheme: Bearer was not authenticated.

My code (based on your documentation):

I have two azure app registration configured, one for angular and one for backend. The frontapp has the callbackUrl since it will be doing the authentication and what I think is that the backendapp will be checking the token when angular makes endpoint calls.
If I use /account/login's AzureActiveDirectory button, I can login and go thru my custom sign in manager (getexternallogin, etc), so I think it is something to do with the call from angular to API. I was passing in auth bearer the rawIdToken from MS, but I think I need to do something else to get the actual access token before calling my API? If someone could guide me I would appreciate it a lot. Thanks in advance
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.