cancel
Showing results for 
Search instead for 
Did you mean: 

MSAL VBO Authentication Issues

TimArgenbright
Level 3

I have been trying to use the MSAL (2.1.0) VBO to authenticate with a registered app to access the Graph API. I am unable to perform any action as they all result in the same error message:

Internal : Could not execute code stage because exception thrown by code stage: One or more errors occurred.

I am unable to dig any deeper due to the generic message it returns. I have not modified the VBO in any way and have made sure these prerequisites are installed:

  1. Collection Manipulation
  2. File Management
  3. Windows Compressed File
  4. Microsoft.Identity.Client.dll that was provided by the MSAL download has been placed in C:\Program Files\Blue Prism Limited\Blue Prism Automate\

I am at a loss as to where to look next as there doesn't seem to be any discussion around this yet. I have even installed this VBO in a fresh installation of Blue Prism 6.9 just to make sure there aren't existing conflictions in our DEV area. What am I missing?

7474.png



------------------------------
Tim Argenbright
------------------------------
6 REPLIES 6

ewilson
Staff
Staff

Hi @TimArgenbright

This is due to an AggregateException being thrown. You should be able to capture it by adding an additional catch like this:

catch (AggregateException err) {
  Exception = err.ToString();
}

Just add the above code snippet immediately after the close curly brace of the MsalServiceException catch block.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,
I'm facing MSAL Authentication issue with the below error. I imported the MSAL.NET v2.2 version with the dll. I have performed the prerequisites as mentioned in the Guide. Can you help me to resolve the issue.

MSAL.Desktop.4.42.1.0.MsalServiceException:

ErrorCode: request_timeout

Microsoft.Identity.Client.MsalServiceException: Request to the endpoint timed out. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Platforms.net45.Http.DnsSensitiveClientHandler.<SendAsync>d__2.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Http.HttpManager.<ExecuteAsync>d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Http.HttpManager.<ExecuteWithRetryAsync>d__12.MoveNext()

   --- End of inner exception stack trace ---

   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<HandleTokenRefreshErrorAsync>d__26.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

   at Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest.<ExecuteAsync>d__2.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor.<ExecuteAsync>d__3.MoveNext()

Inner Exception: System.Threading.Tasks.TaskCanceledException: A task was canceled.

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Platforms.net45.Http.DnsSensitiveClientHandler.<SendAsync>d__2.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Http.HttpManager.<ExecuteAsync>d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.Identity.Client.Http.HttpManager.<ExecuteWithRetryAsync>d__12.MoveNext()

StatusCode: 0

ResponseBody: 

Headers:



------------------------------
Amrutha Sivarajan
------------------------------

Hello @Amrutha Sivarajan,

We're going to need more information.

  • What version of Blue Prism are you using?
  • Which action on the MSAL VBO are you calling?
  • Can you post a screenshot of the action properties (make sure to obscure any sensitive data)?
  • I assume you've set the Tenant ID and other properties?

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thank you @ewilson for the swift response.

Below are details you have asked for:
1. We are using BP7.0 and have configured the Azure as mentioned in the User Guide.

2.  At the stage for Authentication, when it calls the 'Get Auth Token - Client Secret' action, it takes a while to execute and returns the above error message.

3. Screenshots below:
7460.png 7461.png



------------------------------
Amrutha Sivarajan
------------------------------

Hi @Amrutha Sivarajan,

Apologies for the delayed response. Since this is the first action you're calling on the VBO, my guess is the request is being blocked somehow. In other words, the MSAL.NET DLL, which makes the actual network request, is failing to find a network path to Azure. Do you traverse a proxy or anything like that?

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thank you very much for your prompt reply.

Your insight was correct. As the mailbox is shared and necessitates shared permissions, and the proxy must be open for the URLs, I have successfully resolved the authentication issue by opening the firewall and configuring the proxy for the URL.

I appreciate you taking the time to resolve this matter.



------------------------------
Amrutha Sivarajan
------------------------------