You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -690,7 +689,18 @@ public static string GetAccessToken(this ClientRuntimeContext clientContext)
690
689
};
691
690
// Issue a dummy request to get it from the Authorization header
692
691
clientContext.ExecutingWebRequest+=handler;
693
-
clientContext.ExecuteQuery();
692
+
try
693
+
{
694
+
clientContext.ExecuteQuery();
695
+
}
696
+
catch(Exceptionex)
697
+
{
698
+
// This can fail for whatever reason, but if we already have the AccessToken, it doesn't matter
699
+
if(String.IsNullOrEmpty(accessToken))
700
+
{
701
+
thrownewAggregateException("Fetching the AccessToken to inspect whether the ClientContext is AppOnly or not failed. There might be more information in the InnerExceptions.",ex);
0 commit comments