InAnYan / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
0 stars 0 forks source link

Handle error code 1168 #139

Closed koppor closed 3 months ago

koppor commented 3 months ago

I get

WARN: JabRef could not open keyring for retrieving OpenAI API token: com.github.javakeyring.PasswordAccessException: Error code 1168
        at java.keyring@1.0.4/com.github.javakeyring.internal.windows.WinCredentialStoreBackend.getPassword(WinCredentialStoreBackend.java:61)
        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)

I assume, that the password does not exist at all?

That should not be an error message!

The error message "coult not open keyring" is also wrong. It seems, the key ring got opened, but the password was not found?

Note, it is a "jump" from AI prefs directly to JavaKeyring. Thus, nothing todo with remaining JabRef, but with usage of the Keyring API by AI preferences

        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider(JabRefPreferences.java:2858)
InAnYan commented 3 months ago

My bad, I though I followed the JabRef code well (I was looking though other code in JabRefPreferences that uses keyrings)

InAnYan commented 3 months ago

I'll close the issue. I followed everything what JabRef did for operating with keyrings.

I also improved storing of API keys. If key is empty or null, then the API key will be deleted, instead of setting to be empty (like in https://github.com/JabRef/jabref/blob/098bb681509037a1b95d62886746f57d5e32d3d2/src/main/java/org/jabref/preferences/JabRefPreferences.java#L1689)