Skip to content

Instantly share code, notes, and snippets.

@leafac
Created September 22, 2023 15:06
Show Gist options
  • Save leafac/715c227dcf7b7b4fe105fdc6b56ca47f to your computer and use it in GitHub Desktop.
Save leafac/715c227dcf7b7b4fe105fdc6b56ca47f to your computer and use it in GitHub Desktop.
  • Diagnostics tools

  • One key

    • https://www.stackallocated.com/blog/2020/saml-idp-no-shared-keys/
    • All Identity Providers
    • All purposes: signing & encrypting
    • All services: SAML & LTI (OAuth)
    • But metadata is different, because we use the URL to communicate the Identity Provider samlIdentifier, which is necessary to pick up the idpIssuer before we even decode the SAML Response.
    • Pros of separate keys:
      • Probably a bit more secure, given that an issue with a key doesn’t contaminate everything.
      • It’s what we already had before the migration to the new key management system.
    • Pros of same key:
      • Easier to manage (think of initial configuration, rotation, and so forth).
      • It’s what other services seem to do (Moodle, Canvas, Piazza, NOT GRADESCOPE).
      • Setup only once with Identity Provider (think of LTI and its multiple courses with the same institution)
      • Holds up well when we extend the LTI support to sync with the LMS at the installation level (as opposed to the course level as we’re doing now) and create courses in Courselore automatically
  • Create keys with OpenSSL

    $ openssl req -x509 -newkey rsa:2048 -nodes -days 365000 -subj "/CN=courselore.org/C=US/ST=Maryland/L=Baltimore/O=Courselore" -keyout private-key.pem -out certificate.pem
    $ openssl x509 -pubkey -noout -in certificate.pem > public-key.pem
    
    $ openssl rsa -in private-key.pem -text -noout > private-key.txt
    $ openssl rsa -inform PEM -pubin -in public-key.pem -text -noout > public-key.txt
    $ openssl x509 -in certificate.pem -text -noout > certificate.txt
  • Libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment