Problem description
Passport-azure-ad is a plug-in that we need to use when we use node express as the server, passport to verify login, and azure third-party authentication login.
But in the use of the process we may encounter such a situation, that is, clearly all our configuration has been configured, but will encounter unlimited, callback situation, the specific form is that we use the Microsoft account login success, the page will continue to refresh, and finally prompt us can not successfully log in.
This constantly refresh process is actually to send an authentication request in the OAuth login process first. After the authentication is successful, the redirectURL that you configured in advance will be called back. This url is generally a request that our own server needs to handle. In this request, you need to Use the authenticate of passport to authenticate whether the login is successful. If the id-token is empty in this authentication, the request will be initiated again. Once the authentication is successful, the redirectURL will be called.
During this process, if you do authenticate successfully with Microsoft, but do not get the id-token when calling back your server request, there will be an infinite callback situation.