bad sign in error
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
bad sign error should not come when trying to access modern sharepoint sites
Observed Behavior
api are hosted on azure platform and when we are trying to access sharepoit api using user credentials we are facing the below.
The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios.
Microsoft.SharePoint.Client.IdcrlException: The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios. at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.DoPost(String url, String contentType, String body, Func2 webExceptionHandler) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetPartnerTicketFromAdfs(String adfsUrl, String username, String password) 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, EventHandler1 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.GetWebRequestExecutor() at Microsoft.SharePoint.Client.ClientContext.
Thanks for your contribution! Sharing is caring.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Can you provide a bit more information about your environment? Are you positive the credentials provided are accurate? Are you using MFA or Modern Auth?
@andrewconnell @bcameron1231
Environment - SharepointOnline Source -> called in Eventtriggered Azure function (we use post provisioning agent) Yes, We are positive about the credentials used. We use service account for which MFA is disabled to get the client context.
Note: No exception occurs while debugging Azure function locally. Exception happens only in the published code on Azure.
Thank you.
To confirm, when you say debugging locally you mean running the Azure Function in with Azure Function Tools? When you publish the Azure Function, do you make any changes to code or credentials?
Yes, locally with Azure function tools for debugging. And we don't change any code or credentials
Hi! actually we are stuck up at this point ,if any further inputs that would be help @bcameron1231.Thankyou
Hi @shivdk7 , I've been trying to think what the problem could be. The only time I've actually seen this issue with this architecture, is when Azure PowerShell caches credentials from previous runs. That is, I tested against a different tenant, changed my credentials and new Office 365 tenant, and it kept using the old credentials from previous runs.
What baffles me is that it works in your local Azure Function run time but not once it's published. Have you been able to log the values to make sure they are what you are expecting when the Azure Function runs?
Hi @bcameron1231 , we were able to log the values and it is the same what we expect when Azure functions runs.
By chance are you able to send the sln? You can strip out any proprietary information. I am unable to repro connections from my side of things.
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.
Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues