Open silenuz opened 3 years ago
I have exactly the same issue (running W10 20H2)
@silenuz were you are to resolve the issue. If yes, can you please share the steps.
Line 63 in the windowskeyring.go file is where it breaks.
On line 63:
// Since these params are optional, ignore not found errors
if err.Error() != keyring.ErrNotFound.Error() {
return result, err
}
At this point err is nil. So maybe it should be:
// Since these params are optional, ignore not found errors
if err != nil && err.Error() != keyring.ErrNotFound.Error() {
return result, err
}
The code is in Go, so it's easy enough to fix and recompile. As this project seems abandoned if there is interest I may consider forking this project and fixing it.
This was a real pain to work around, works fine on mac fails in windows. Worked past it by doing the setup and the connect via powershell command line invoked through a java program. The refresh code was done in java using com.google.api.client.auth.oauth2 APIs to refresh the token.
I suspect the bug occurs when the key storage requirements doesn't need a second 2 windows key ring because the number of scopes is small enough to fit into one key ring. When it tries to read back the second key ring it crashes. I'd rather Xero fix this and create another executable rather than download and install the go environment myself.
While version 1.0 didn't allow saving to the local keychain in windows, which appears to be fixed in 1.1, however while it's nice that they are actually saved now it is impossible to retrieve them.
a call to xoauth token client results in:
Which in turns breaks the --refresh option as well. It would be nice to have a working version on windows.
Update: I don't believe it is actually saving the tokens in the keychain. If one deletes a connection, this is the output:
Found the problem. It's in the windowskeyring.go file. Inthe following function
func (service WindowsKeyRingService) GetTokens(item string) (oidc.TokenResultSet, error)
On line 63:
At this point err is nil. So maybe it should be something like:
This fixed problems for me, but unfortunately I am unfamiliar with GO and have to now figure out how to recompile.