This was resolved by requesting for an additional scope "User.Read" apart from the basic scopes ("openid", "profile" and "email") during user authentication. It appears that this also depends on the AD settings of the organisation to which the user belongs. For some users the basic scopes were enough to get the id_token in OAuth2 token response, but for users belonging to some specific organisation "User.read" scope had to be added to get id_token in OAuth2 token response.
"id_token" is not present in Oauth2 token received from Microsoft login for some users.
I am using Microsoft as an Identity provider in my application. The problem is that I am not receiving "id_token" in Oauth2 token response even though I am requesting "openid" scope (scopes requested: openid profile email) everytime. For only one user it is working fine and for all the other users we are facing this issue.
I am using the common authorization and token endpoints: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Two factor authentication is enabled for the organisation in which the MS app is created. The Include ID Token in OAuth token option in the MS app is also enabled