Topic on Talk:OAuth/Owner-only consumers

Johnywhy (talkcontribs)

Special:OAuthConsumerRegistration/propose says:

Please provide a public RSA key (in PEM format) if possible; otherwise a (less secure) secret token will have to be used.

  • Where can i obtain a public RSA key?
  • Where do i put the private key?
Tgr (WMF) (talkcontribs)

If you are not familiar with how to use RSA keys, you are probably better off not using them (just leave the box empty); the security advantages are not that large. The description should probably be improved to say so (even better would be to have a radio box for RSA vs. hash and only show the textbox when the first option is selected).

Johnywhy (talkcontribs)

"If you are not familiar with how to use RSA keys, you are probably better off not using them"

Let's assume for the moment that i'm intelligent enough to understand it.

Can you answer the questions?

I used PuTTYgen to generate a pair-- can i use that pair?

The site i'm building requires the strongest available security, as the site may be targeted by hackers.

Tgr (WMF) (talkcontribs)

I don't think PuTTY supports PEM but it's been a long time since I last used it.

Johnywhy (talkcontribs)
Tgr (WMF) (talkcontribs)

If it's an RSA key in PEM format, it should work. You can generate other kinds of keys with PuTTY so check your settings.

Johnywhy (talkcontribs)
Tgr (WMF) (talkcontribs)

You need to sign the API requests with it. That's not something you want to do by hand; there are bunch of OAuth 1 libraries around. The doc page has an example (using oauthclient-php); the relevant part is starting at $api_req = OAuthRequest::from_consumer_and_token.

Johnywhy (talkcontribs)

thx, but that's server-side php.

i want to do the API calls in javascript, from the client.

Tgr (WMF) (talkcontribs)

Well, the idea is the same, you just need a different library. You could use ddo/oauth-1.0a for example.

Johnywhy (talkcontribs)
Tgr (WMF) (talkcontribs)
Reply to "Obtaining RSA Key?"