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

feat: idp cert fingerprint and actual idp cert #551

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svennjegac
Copy link

@svennjegac svennjegac commented Feb 9, 2024

Service provider should not depend on IDP metadata url being specified.

This PR adds two more options for configuring SP:

  • Configure IDP certificate fingerprint and fingerprint algorithm
  • Configure actual IDP certificate

Please be so kind and take it into consideration @crewjam


// IDPCertificate to use as idp public certificate. If this field is specified, IDPCertificateFingerprint and
// IDPCertificateFingerprintAlgorithm must not be specified.
IDPCertificate *string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IDPCertificate *string
IDPCertificate *x509.Certificate

Firstly, thank you for this PR. This functionality is something I also want from this package!

Just a thought, maybe the type here should just be a x509.Certificate and the consumer should be responsible for parsing their certificate themselves.

The reason I suggest this is that it's not certain that everyone is going to be using base64-encoded ASN.1 DER strings for their certificates (which it appears from parseCert yours does).

In my case, my (legacy) application simply has them encoded as PEM strings like so: -----BEGIN CERTIFICATE-----\r\nABCEDFG\r\n-----END CERTIFICATE-----, so to use your PR I would likely need to use pem.Decode, then base-64 encode the string, just to provide it to this package, which then base64-decodes it again.

I think this change would make it more reusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants