-
Notifications
You must be signed in to change notification settings - Fork 38
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
problem with github synchronization #321
Comments
Hmm, that does look very much like a token failure I am afraid. If github does not return an expire date for a token, its because its failed (for some reason) to authenticate using that token. I doubt Github has changed the API, mine is working fine. But maybe I had better check the API doc, just in case. It sure has changed in the past ... David |
Have you tried generating a new token ?
yes. I'm sure the token is not expire
|
There can be other problems with the token apart from it expiring. Github has introduced a much finer grain control on the token, to limit what it can do to specific tasks. Might be a good idea but I have not investigated. I am wondering if your problem is that your token, while not expired does not grant you the appropriate permissions. So, when creating a token, choose "Classic" then in the next screen, tick the Repo Scope box. I just generated a new token, as above, and its working fine. I see this when I run (after stopping any existing tomboy-ng instance)- (trigger a sync)
I assume you have tried the debug-sync option, you see the line about "about to get auth-token-expire" and "Confirmed account exists" and then see the message about "Username exists but Token Failure" ? Are you seeing any other error messages ? Particularly from TGitHubSync.Downloader ? What I understand here is that github is accepting your token, checks the username is OK (proving the call was successful) but does not return an an authentication header, perhaps because the token permissions does not allow it to ? Unless we are seeing other (transport) errors, it sure looks like the token is not acceptable to github for what we are trying to do. Please check for the other error messages ? Davo |
Did some more debugging, and looked at headers with curl. I confirm that the authenticated Github answer, with a working token, does not contain header
No idea why. |
Right, useful info indeed. My header looks (functionally) indntical to yours except I have that expiry date. Martin, apparently its possible to create a classic token with no expiry date. I imagine the token will work fine but I have assumed all tokens will have an expiry. Perhaps that is not a good idea ? Is it possible that the token you are using does not, in fact, have an expiry date ? Obviously, tomboy-ng has no interest in the expiry date apart from keeping the user informed. I can, and should 'adjust' the code to proceed if it does not detect one. Its just that was a suitable test of the first header back to ensure we talking correctly. I am currently away from home dealing with a family problem and don't have all my test hardware available. But I could, I assume, cut you a test binary that allows the sync to proceed even if no expiry is found. I should be able to pick something else out of the header to use as a comms check. What platform do you use ? (Windows, Mac, Linux [gtk2, qt5, qt6]) Davo |
I notice that I cannot sync anymore to Github.
The error is "Username exists but Token Failure"
https://github.com/tomboy-notes/tomboy-ng/blob/master/source/transgithub.pas
I triple-checked the token, so it seems that
HeaderOut
orTokenExpires = ''
is wrong.The text was updated successfully, but these errors were encountered: