I am able to Do Authentication and Authorization for my .netcore MVC app+reactjs (Billing App) this application will be hosted on IIS, and on the same server planning to host the .netcore Webapi (chart App).
By using Billing App we will call the chart WebApis. NOW WebApi should be Authenticate/Authorize user based on token sent by front-end app (token-based webapi that does Authe/Autho, no another login pop-up)
Able to Generate token using postman-see img by requesting below link
https://login.microsoftonline.com/{{tenandId}}/oauth2/token
Will sent this token with the header to Web-API, which will be having the same configuration of Azure AD app (client id, scope, etc.) as Billing App has. Api should validate the token and send the chart data.
- Should try adal/msal in reactjs so and decorate WebApis with Authorize attribute so that will take care of Authentication & Authorization?
Got many link but few code aren't working and few process is no more works for Azure, and few are having huge code and not what exactly I am looking for.
Basically I'll host one App in .netcore that does Auth part, now the WebApi should also be Auth using same user cookies/token because I don't wanna give another login popup, see lot of MS sample code but no luck
Which approach is right 1 or 2, and share sample code/link any help appreciated,