Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sso_proxy: document request signing #185

Open
mccutchen opened this issue May 1, 2019 · 4 comments
Open

sso_proxy: document request signing #185

mccutchen opened this issue May 1, 2019 · 4 comments
Labels
docs Documentation good first issue Good for newcomers

Comments

@mccutchen
Copy link
Contributor

mccutchen commented May 1, 2019

Is your feature request related to a problem? Please describe.

The public key-based request signing functionality added to sso_proxy in #106 is undocumented. In particular, it's not immediately obvious how to a) generate an appropriate keypair or b) validate a signed request in an upstream service.

Describe the solution you'd like

New documentation for this functionality, ideally accompanied by a reference implementation for verifying a signed request.

To start, generating an appropriate keypair for sso_proxy to use for signing requests is as simple as

openssl genrsa -out priv.out 2048
@mccutchen mccutchen added docs Documentation good first issue Good for newcomers labels May 1, 2019
@mccutchen
Copy link
Contributor Author

mccutchen commented May 1, 2019

Note: The old method for request signing (based on a per-upstream shared secret) is documented here:
https://github.com/buzzfeed/sso/blob/master/docs/sso_config.md#request-signing

Those docs should probably be deprecated or removed in favor of the new approach!

@mccutchen
Copy link
Contributor Author

To start, generating an appropriate keypair for sso_proxy to use for signing requests is as simple as

openssl genrsa -out priv.out 2048

Turns out the above generates a key in PKCS#1 format (I think?), but we need one in PKCS#8 format, which requires an extra conversion step. Luckily, this is still relatively straightforward to do in one pass:

openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt

Many thanks to the wizards of Stack Overflow for explaining this.

@nebevservian
Copy link

I found the documentation pretty sparse and needed a NodeJS application to verify the signatures.

I created a library at: https://www.npmjs.com/package/signature-verifier-buzzfeed-sso

Hopefully this helps someone.

@sporkmonger
Copy link
Contributor

Is it possible to do request signing with not-RSA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants