User-api-key returning error on generating new key

Hi, I’m developing an app that wants to access Discourse through the user api. Everything works fine up until the point where Discourse should redirect with the newly generated user api key.

Error message in the API logs: OpenSSL::PKey::RSAError (data too large for key size)

This is the request leading up to the error:

https://myforum.se/user-api-key/new?auth_redirect=https%3A%2F%2F1aff6e79.ngrok.io%2Fauth_redirect&application_name=Discourse%20Lanes&client_id=discourse-lanes&scopes=read%2Cwrite&public_key=-----BEGIN%20PUBLIC%20KEY-----%0AMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIaAlveu4rD1xwFOMfI0QJzLjBgomdAt%0Adq0DFydzepQqwVmZxFjYzNTG8VO0yLQbr4wxXQLoAgKnf16Wm2Qk0CUCAwEAAQ%3D%3D%0A-----END%20PUBLIC%20KEY-----&nonce=876876

Should I pass another type of public key to user-api-key/new or how could I resolve this?

1 Like

Solved: used a 1024 bit key instead of 512.

5 Likes