We are working on a project where we are authenticating users with Azure Active Directory. Upon the successful authentication, the user's browsers receive an Id and Access token, and then we use the same access token to query other Microsoft products (Sharepoint, OneDrive, etc).
We also have to authenticate our users with Elastic Search when they try to search for something on our application. For that, We set up an elastic OIDC realm on the elastic search cluster and authenticating our users with it using a custom web app as a Relying Party. In simple words, the same user which was successfully authenticated earlier is asked to authenticate again in elastic by redirecting the browser to the redirect Uri (dataset1**) that is sent back to AAD. However, when the redirection is done in the user’s browser, the authentication pop-up comes up again and the client has to select the username to get the response. However, an access token is picked up from the cache storage and the password is not requested again.
Is there a way to avoid opening the Microsoft authentication page (second time) and get the token silently? We are fine with redirecting the user to the authentication page but it should not ask the users to click on their user name and should return back to the application with the token.
dataset1**
Here is my angular code which redirects the user to redirect uri –
AuthenticateElastic(): void {
this.azureFunctionService.PrepElastic()
.subscribe((authenticationResponse: any) => {
this.dataShareService.setstate(authenticationResponse.state);
this.dataShareService.setnonce(authenticationResponse.nonce);
**document.location.href = authenticationResponse.redirect;**
});
}
The redirect URI which is shared above dataset1** is set for document.location.href which redirects the user browser and authentication popup comes up again. document.location.href = authenticationResponse.redirect;

