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

EPA-111: EntityStatement tweaks for compatibility #76

Merged
merged 5 commits into from
May 14, 2024

Conversation

thomasrichner-oviva
Copy link
Contributor

@thomasrichner-oviva thomasrichner-oviva commented Apr 30, 2024

also fixes #74

now the following sectoral IdPs somewhat work:

  • Barmer
  • IBM

RISE is still somehow broken

Comment on lines +82 to +88
var cert =
X509CertificateUtils.generateSelfSigned(
new Issuer(issuer),
Date.from(nbf),
Date.from(exp),
key.toPublicKey(),
key.toPrivateKey());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the important bit to have an mTLS client cert.

@@ -109,7 +111,13 @@ public void start() throws ExecutionException, InterruptedException {
var tokenIssuer = new TokenIssuerImpl(config.baseUri(), keyStore, codeRepo);
var sessionRepo = buildSessionRepo(config.sessionStore(), meterRegistry);

var httpClient = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(5)).build();
var sslContext = TlsContext.fromClientCertificate(config.federation().entitySigningKey());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds the client certificate to the list of certificates to use for authentication.


// according to the federation spec this is not required here, some
// sectoral IdPs require it though
.defaultAcrValues(List.of("gematik-ehealth-loa-high"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

see also #74

import org.bouncycastle.operator.OperatorCreationException;
import org.junit.jupiter.api.Test;

class TlsContextTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO :D

@thomasrichner-oviva thomasrichner-oviva force-pushed the feature/epa-111 branch 3 times, most recently from 84e525f to 6ba3933 Compare May 2, 2024 11:17
Copy link
Collaborator

@michelealbanese-oviva michelealbanese-oviva left a comment

Choose a reason for hiding this comment

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

LGTM, good job 💪 some minor nitpicks, also feel free to re-request once you have more complete tests

private JWKSet generateJwks(KeyUse keyUse) throws JOSEException {
var key = new ECKeyGenerator(Curve.P_256).keyUse(keyUse).keyIDFromThumbprint(true).generate();
return new JWKSet(key);
private String deriveName(URI issuer) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you provide a clearer name? maybe deriveFdpNameFromHost or something similar?

return new JWKSet(key);
private String deriveName(URI issuer) {
var s = issuer.toString();
s = s.replaceAll("^https://", "");
Copy link
Collaborator

Choose a reason for hiding this comment

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

hopefully nobody is using plain http 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If they do, it won't work with the federation 🤷

Copy link

sonarcloud bot commented May 14, 2024

@thomasrichner-oviva thomasrichner-oviva merged commit 70b9782 into main May 14, 2024
7 checks passed
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.

Barmer Sektoraler IDP
2 participants