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
Recently, my testing indicate that the OAuth server (mostly on US weekends) fails with "User authentication required". Attempts to re-authenticate fail as well. From the code below, looks like 401,403 is the reason. Could you please elaborate on the root cause, and if it is (as we believe) a server issue, sharpen the error message to the user?
Hi @pbrondum SalesforceError.userAuthenticationRequired is not intended to be exposed to the end user; it is a signal to Swiftly Salesforce that user authentication is required, and Swiftly Salesforce will then display the Salesforce-hosted OAuth authentication and authorization forms.
A status code of 401 is the more common error - it can occur when the session ID has expired, or if the refresh token has been revoked.
A status code of 403 could indicate that the org doesn't have API enabled (e.g. Professional Edition without optional API add-on), or that the username is associated with a different org, for example.
What did you mean by "re-authentication fails as well"? That the Salesforce-hosted login or authorization form displays an error? Or that the refresh token cannot be used to get a new access token?
Given the above, it would be helpful if Swiftly Salesforce acted differently in the case of a 403 error caused by lack of API support. There's no point having a user of Professional Edition without API log in again since authentication will not solve the problem. I'll add that enhancement in an upcoming version.
Recently, my testing indicate that the OAuth server (mostly on US weekends) fails with "User authentication required". Attempts to re-authenticate fail as well. From the code below, looks like 401,403 is the reason. Could you please elaborate on the root cause, and if it is (as we believe) a server issue, sharpen the error message to the user?
fileprivate func send<T,U>(urlRequest: URLRequest, jsonDeserializer: @escaping (U) throws -> T) -> Promise {
return Promise {
fulfill, reject in
Alamofire.request(urlRequest)
.validate {
(request, response, data) -> Request.ValidationResult in
switch response.statusCode {
case 401, 403:
return .failure(SalesforceError.userAuthenticationRequired)
The text was updated successfully, but these errors were encountered: