
Ask HN: Is there an API key generator? - juancampa
Every time I&#x27;m integrating with a new service I have to figure out how to generate an API key for it. Wouldn&#x27;t it be nice if you could do something like:<p><pre><code>  $ gen-api-key gmail
  username: &lt;username&gt;
  password:
  working...
  Client ID: XXXXXXX
  Client Secret: XXXXXXX
</code></pre>
Are there any efforts to standardize this process? Something like ACME (used to generate TLS certs) but for API keys?
======
niftich
There are emerging standards around this -- in the sense of, you, as the agent
to a new client, providing some information and gaining delegated access,
complete with API keys, to some established resource server -- but deployment
is fairly low.

OIDC: Dynamic Client Registration: [https://openid.net/specs/openid-connect-
registration-1_0.htm...](https://openid.net/specs/openid-connect-
registration-1_0.html)

OAuth 2.0: RFC 7591
[https://tools.ietf.org/html/rfc7591](https://tools.ietf.org/html/rfc7591)

------
AznHisoka
I just do something like this in Ruby. There's probably a way to do it in
every language:

clientId = SecureRandom.hex(12)

clientSecret = SecureRandom.hex(12)

~~~
anonfunction
I think OP is talking about generating keys from third party providers. Like
generating a key from sendgrid or stripe without going to their website / UI.

~~~
juancampa
Yup, that's what I meant. Thanks

