Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout is failing #120

Closed
camiloduqued opened this issue Jun 18, 2020 · 8 comments
Closed

Logout is failing #120

camiloduqued opened this issue Jun 18, 2020 · 8 comments
Assignees

Comments

@camiloduqued
Copy link

I'm having issues with the logout since I updated Swiftly Salesforce to version 8.0.0, I added the package with the Swift Package Manager and updated the implementation to the Combine framework. Sometimes it fails and sometimes it's successful.

When it fails the request made at the OAuthManager revoke function responds with a status 404 and the body (data) is "Bad_Id".

It's weird because that error is not supposed to be sent at the revoke endpoint, so the code maps it to an OAuthManagerError.endpointFailure with code "Unknown".

image

The request URL and the body are fine, I even tried to make the same request separately (but using query parameters instead of body) with the same token and it was successful. I think this was a coincidence because I edited the code to use query parameters and it's still failing.

@mike4aday mike4aday self-assigned this Jun 19, 2020
@mike4aday
Copy link
Owner

Thanks @camiloduqued - I've not seen this before and will try to figure out what's going on. Were you able to see if the token was revoked on the Salesforce side?

@camiloduqued
Copy link
Author

No @mike4aday, the token was not revoked, even as it fails the user is not removed from the User Defaults, so when I try to login again, it skips the Salesforce Login and all the subsequent requests are successful.

@mike4aday
Copy link
Owner

Thanks @camiloduqued - I'll look into this.

@mike4aday
Copy link
Owner

Hi @camiloduqued - which OAuth scopes did you select in your Connected App definition?

@camiloduqued
Copy link
Author

Hi @mike4aday, I selected these scopes:
image

@mike4aday
Copy link
Owner

Hi @camiloduqued - I'm still checking into this. As you noted, 404 and "Bad_Id" is not documented as a possible result of a call to the OAuth 'revoke' endpoint. Back to you soon.

@mike4aday
Copy link
Owner

@camiloduqued - I asked experts at Salesforce and so far the only possible explanation is that the request to the 'revoke' endpoint is coming from an 'invalid domain.' Are you able to provide a trace route of the path from the caller to the 'revoke' endpoint? Approximately how often do you see the failure (as % of all calls to revoke)? I've not been able to replicate the issue.

@mike4aday
Copy link
Owner

@camiloduqued I'll close this for now; re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants