UiPathTeam.SharePoint.Activities Authentication exception: The sign-in name or password does not match one in the Microsoft account system

Hi All,

I am using the UiPathTeam.SharePoint.Activities on a windows legacy project to connect to SharePoint and I experiencing this authentication error. The bot has been running fine using this method for a long time until it failed yesterday.

image

Here are some additional details:

  1. Studio Version 2022.10.5
  2. Robot is running on Window Server 2019
  3. Account used does not have MFA enabled.
  4. I am using the latest version of the package which is version 1.7.0

I have doubled check and the login credentials stored on orchestrator is correct and I can manually authenticate through the browser.

Here is the exception message extracted through the debug mode:

RemoteException wrapping Microsoft.SharePoint.Client.IdcrlException: The sign-in name or password does not match one in the Microsoft account system. 
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String securityXml,
String serviceTarget,
String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username,
String password,
String serviceTarget,
String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url,
String username,
SecureString password,
Boolean alwaysThrowOnFailure,
EventHandler`1 executingWebRequest)
   at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url,
Boolean refresh,
Boolean alwaysThrowOnFailure)
   at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context,
HttpWebRequest request)
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
   at UiPathTeam.SharePoint.SharePointContextInfo.GetSharePointContext()
   at UiPathTeam.SharePoint.Activities.Lists.ReadListItems.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Any advise, workaround or solution is much appreciated :slight_smile: .

2 Likes

@Yap_Derek

This has been an open issue…workaround or better solution would be to move to office 365 activities

Cheers

2 Likes

Hi @Yap_Derek ,

We have recently faced exactly same issue for all of the projects using Sharepoint (v 1.7.0) activities.

For us also, all these processes have been running fine using these activities so far until recently.

Looks like this issue was suddenly popped up(not immediate, after a while though) after an upgrade to UiPath v2020.10.x
Can you confirm if you also upgraded recently? How long have your processes been running fine with studio v2020.10.x?

Resolution that has worked for us:
As shared by @Anil_G(Thank you Anil for linking the post) in above post,
We are moving all our processes to using Office365 package and many of those are already confirmed to be running fine post switching to O365 activities.
You may look towards same resolution as we could not find any other resolution for this issue so far.(If you are able to find something , let us know as well)

Please note:
You may need to check with security/admin team in your organization for Office 365 set up and have activities enabled accordingly.

Regards
Sonali

Thanks for your answer @sonaliaggarwal47.

I have not upgraded to v2020.10.x recently. When I started working on UiPath projects, the studio version I work with is already version 2022.10.5 and we have been running this version for the past 7-8 months.
I will look into the o356 activities as suggested.

Thanks :slight_smile:

2 Likes

Hi @Yap_Derek ,

Just some more info to help you out a bit(we did have various challenges ahead of us to enable O365 package), thus sharing few learnings:

Out of 4 authentication types listed below, only few options turned to be applicable to us(per our internal configurations):

  1. Interactive Token → only applicable for attended users but can be used if your organization’s internal configurations allow.

  2. Integrated Windows authentication → suitable for unattended users but can not be used if MFA(multi-factor authentication) is enabled in an organization.

  3. Username and Password → suitable for unattended users but can not be used if MFA(multi-factor authentication) is enabled in an organization.

  4. Application Id and Secret → suitable for unattended users if MFA is enabled, however this leaves apps exposed to a great extent if not restricted properly. Hence, you may need to go ahead with restricting it as needed thus allowing control over only required sites/mailboxes and their corresponding access levels(read/write/full) which means This ofice365 package would only work for sites/mailboxes that are added in the whitelist(under API permissions Sites.Selected) irrespective of the availability of app id and secret.

So, you would need to check which permissions(delegated/application level) can be enabled per your organization’s configuration.

Below are the links that we had gathered during our research on this package, see if it helps:

https://docs.uipath.com/activities/docs/office365-setup

https://docs.uipath.com/activities/docs/microsoft-office-365-scope
https://docs.uipath.com/activities/docs/about-the-microsoft-office-365-activities-pack

Regards
Sonali

1 Like

Thanks a lot for the comprehensive answer @sonaliaggarwal47!

In long term I will slowly replace the custom SharePoint package activity with the Office 365 package.
A short term solution I found that works for me is to change the login method from “Online” to “AzureApp” and to log in using the Application ID, Username & Password.

You will still have to create an Azure AD app as shown in the Office365 package setup tutorial/guide.

HI @Yap_Derek ,

I am curious to know the working of this.

Could you please share some more details, might come handy for us as well?

Once you have added api permissions in azure app, you created a studio project and post that where did you change the method from online to azure app?

Does it work for both attended and unattended automations?

Regards
Sonali

Hi @sonaliaggarwal47 ,

Using the SharePoint Custom Activities package, in the SharePoint Application Scope activity set the Login Mode to “AzureApp”. Then you will need to give it the AzureAppID, username and password as well as select the “AzureAppPermissions” from the dropdown – Read, Write, Manage, Full Control (can select more than one).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.