oviva-ag / ehealthid-relying-party

OpenID Connect Relying Party for Germany's GesundheitsID (eHealthID)
Apache License 2.0
16 stars 3 forks source link

Unable to Run the AuthenticationFlowExampleTest.java #91

Closed sureshcankado closed 2 months ago

sureshcankado commented 2 months ago

Hi, I used the following values to run the AuthenticationFlowExampleTest

var fedmaster = URI.create("https://app-ref.federationmaster.de/"); var self = URI.create("https://idp-test.oviva.io/auth/realms/master/ehealthid");

// this URI must be listed in your entity statement, configure as needed var redirectUri = URI.create("https://diga.cankado.com/auth/callback");

// those MUST be at most the ones you requested when handing in the entity statement var scopes = List.of("openid"); var sektoralerIdpIss = "https://gsi-ref.dev.gematik.solutions/";

Getting following Error:

com.oviva.ehealthid.fedclient.api.HttpException: http request failed: bad status 'GET https://gsi-ref.dev.gematik.solutions/.well-known/openid-federation' status=403 at com.oviva.ehealthid.fedclient.api.HttpExceptions.httpFailBadStatus(HttpExceptions.java:10) at com.oviva.ehealthid.fedclient.api.FederationApiClientImpl.doGetRequest(FederationApiClientImpl.java:74) at com.oviva.ehealthid.fedclient.api.FederationApiClientImpl.fetchEntityConfiguration(FederationApiClientImpl.java:54) at com.oviva.ehealthid.fedclient.api.CachedFederationApiClient.lambda$2(CachedFederationApiClient.java:47) at com.oviva.ehealthid.fedclient.api.InMemoryCacheImpl.lambda$0(InMemoryCacheImpl.java:29) at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) at com.oviva.ehealthid.fedclient.api.InMemoryCacheImpl.computeIfAbsent(InMemoryCacheImpl.java:23) at com.oviva.ehealthid.fedclient.api.CachedFederationApiClient.fetchEntityConfiguration(CachedFederationApiClient.java:46) at com.oviva.ehealthid.fedclient.FederationMasterClientImpl.fetchTrustedEntityConfiguration(FederationMasterClientImpl.java:51) at com.oviva.ehealthid.fedclient.FederationMasterClientImpl.establishIdpTrust(FederationMasterClientImpl.java:46) at com.oviva.ehealthid.auth.internal.steps.SelectSectoralIdpStepImpl.redirectToSectoralIdp(SelectSectoralIdpStepImpl.java:66) at com.oviva.ehealthid.auth.AuthenticationFlowExampleTest.flowIntegrationTest(AuthenticationFlowExampleTest.java:100) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

thomasrichner-oviva commented 2 months ago

Most likely you are lacking pre-requisites as documented here: https://github.com/oviva-ag/ehealthid-relying-party/blob/main/TESTING.md

Please go through Gematik's documentation on how to test against their environment.

henryallsuch commented 2 weeks ago

I believe this issue is caused by differences in GematikHeaderDecoratorHttpClient.java in test and the actual one.

https://github.com/oviva-ag/ehealthid-relying-party/blob/main/ehealthid/src/test/java/com/oviva/ehealthid/test/GematikHeaderDecoratorHttpClient.java

https://github.com/oviva-ag/ehealthid-relying-party/blob/main/ehealthid-rp/src/main/java/com/oviva/ehealthid/relyingparty/poc/GematikHeaderDecoratorHttpClient.java

This had me going round in circles this week.