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
Synapse login not the same with authToken
and apiKey
#869
Comments
@sujaypatil96 I'm having some trouble reproducing this issue. Could you show the [authentication] sections of the synapseConfig file you are using with 2.2.2 and 2.3.1, respectively (with secrets redacted of course). One potential issue I am aware of is that in 2.3.1 if you are using an email address (rather than the username) as your synapseConfig username this works with an apiKey but not with an authToken. This is fixed in the upcoming 2.4 version (username is not needed at all with an authToken, but if provided it is checked and this check was not working properly with an email/authToken pair). The above case aside, here are my own steps to attempt to reproduce this:
|
@jkiang13: Yes, absolutely. So I was testing with just version
I commented out |
Oh, I think you should be doing |
@sujaypatil96 is it just the lack of output or is the login not functioning (i.e. are you able to perform authenticated activity)? If it's the former, what output are you anticipating? In my output above in 2.2.2, with silent=True, upon login I get the warning about the availability of the newer version, but no other output. When using the latest version there is no output, but that is expected with silent=True (arguably the new version warning should also be suppressed with silent=True). Without silent=True there is a console message about the successful login. |
You're right, I did mean to do syn.login, but in this case it didn't matter (because I happened to be using the default configPath anyway)
Can you run the following after the output-less login?
|
This is what I'm seeing @jkiang13. |
@sujaypatil96 Hmm, can you verify that the auth token is exactly one generated from your settings at synapse.org (for example no characters accidentally omitted when pasting it into your config file). One way to confirm that it is a valid token is to run the following from the command line:
Replacing with your auth token. If a valid token it should return some JSON describing your user profile. If an invalid token, should return some JSON with an error message. While debugging this I noticed some cases where an invalid token causes the backend to return a 500 error (rather than a 401 status code) which causes the client to retry (and appear to hang). I wonder if that is what is happening in your case. |
Thanks for sending the above command to me @jkiang13. I ran it, and here is the output:
It is a valid token, since it's returning a valid JSON with my user credentials. So the token doesn't seem to be the problem. Let me know if you feel like a call will help debug this better? |
Just updating this issue with the real reason as to why I was encountering this problem. Turns out it has to do with inconsistency in specifying the |
I've created the following JIRA issue to track whether to support quoted config values: https://sagebionetworks.jira.com/browse/SYNPY-1162 . It turns out that most config values do NOT currently support quoted strings, it just so happens that both username and apiKey do because of side effects (see the JIRA issue for details) rather than as intentional decisions, so there is some behavioral inconsistency. With the JIRA issue open, I'll close this GitHub issue. Debugging this also revealed https://sagebionetworks.jira.com/browse/PLFM-6803 |
Bug Report
Operating system
MacOS Big Sur
Client version
Versions
2.2.2
and2.3.1
.Description of the problem
When using the
.synapseConfig
file (with theapiKey
attribute) as in (for example)synapseclient==2.2.2
) thesynapseclient.Synapse.login()
method works perfectly. However, when using the.synapseConfig
(with theauthToken
attribute) as in (for example),synapseclient==2.3.1
), thelogin
method doesn't work as expected.A minimal reproducible example:
2.2.2
of thesynapseclient
2.3.1
Note: Make sure to you the right versions of the
.synapseConfig
file too.Expected behavior
User should be logged in successfully.
Actual behavior
No output to console when testing with
synapseclient==2.3.1
and using.synapseConfig
file withauthToken
.The text was updated successfully, but these errors were encountered: