1

Asp.net core react.js project in VS 2022 configured with Azure Ad authentication, ID token (App type: Web App, not SPA).

Requirement: I have to authenticate all users(internal) before server "serves" or "delivers" the js app.

Reason: App will be hosted publicly, and home screen (index page) will contain intellectual data.

I found this article about "Authentication about Asp.net core and react". here is the link "Deploy" typically means "bring something to (production) server". So, no your server does not "deploy" the js file but it "serves" or "delivers" the js app. (it brings it from server to your users web browser). authentication wraps around the js files. I really hope it is simple, just few lines code in startup class.

I have to have Azure Ad authentication before server serves any js files.

Or,

Any other better solution or, github template would be much appreciated.

Keep in mind, I am new in React, decent in asp.net.

1 Answer 1

2

The Microsoft Authentication Library for JavaScript enables both client-side and server-side JavaScript applications to authenticate users using Azure AD .

If you are using react.js as front end technology , Then to authenticate Azure Active Directory you can use Implicit Grand Flow and it is recommended to use your app as a single page application as per documents.

The library which can help you is MSAL.js and you can find MSAL.js code sample here.

For more details refer this Documents

1) https://medium.com/@jaguarsingh/setting-up-active-directory-authentication-with-react-js-and-net-core-5-3bc3ac1647f7

2) https://www.nubo.eu/How-do-I-authenticate-against-Azure-AD-using-React-SPA-and-ASP-NET-Core/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.