keyring-node icon indicating copy to clipboard operation
keyring-node copied to clipboard

Generic failure - Attribute 'password encoded as UTF-16' is longer than platform limit of 2560 chars

Open ItaiBolyasni25 opened this issue 3 months ago • 1 comments

Hello, i have a weird bug that i cant make sense out of it, hoping you could help me clear it out.

I am saving a jwt access token that is around 1300 characters long, using the setPassword method. The token itself is simple utf-8 characters. But i always get the error that i am going over the limit of chars for my Windows platform.

I don't understand why key ring fails to save the password when its clearly less than the limit. Any help would be appreciated!

ItaiBolyasni25 avatar Sep 17 '25 15:09 ItaiBolyasni25

Actually i might have figured out whats happening. Its because keyring is transforming my utf-8 string to utf-16 which basically doubles the bytes and goes over the limit. Is there a way to force the value to stay utf-8? Should i maybe no use setPassword but use another method to be able to save my access token?

ItaiBolyasni25 avatar Sep 17 '25 15:09 ItaiBolyasni25