Azure AD is used as the authentication provider for the created web application.
We followed the web browser in the web application script specified here .
This is an application with several main sections. We would like to add new components and use client rendering technologies such as React or Angular.
For these technologies, we would like to use a single page script as described here . Since we use React, we could not use the SPA script above, as indicated. Using this example , we have added authentication code for API calls in our add-on. Authentication happens on the part of JavaScript, but actually causes a page reload.
Is there a way to unify web browser authentication approaches to a web application and JavaScript to web API scripts?
EDIT: I made a sample project that is trying to combine both scenarios for authentication. In this, I suppose, the question boils down to exchanging input information with the AuthenticationContext JS authentication class. On the TodoAPP controller, I include this login code:
<script type="text/javascript">
var authContext = new AuthenticationContext(config);
var user = authContext.getCachedUser();
if (!user) {
authContext.login();
}
</script>
, , , .