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
@@ -692,7 +691,18 @@ public static string GetAccessToken(this ClientRuntimeContext clientContext)
692
691
};
693
692
// Issue a dummy request to get it from the Authorization header
694
693
clientContext.ExecutingWebRequest+=handler;
695
-
clientContext.ExecuteQuery();
694
+
try
695
+
{
696
+
clientContext.ExecuteQuery();
697
+
}
698
+
catch(Exceptionex)
699
+
{
700
+
// This can fail for whatever reason, but if we already have the AccessToken, it doesn't matter
701
+
if(String.IsNullOrEmpty(accessToken))
702
+
{
703
+
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