Added additional authentication handling for the case when AAD forbids authentication.