aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service')
-rw-r--r--id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/EhvdCommunicationService.java32
-rw-r--r--id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/IEhvdCommunication.java7
2 files changed, 32 insertions, 7 deletions
diff --git a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/EhvdCommunicationService.java b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/EhvdCommunicationService.java
index 900adaff7..cf58fe718 100644
--- a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/EhvdCommunicationService.java
+++ b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/EhvdCommunicationService.java
@@ -83,7 +83,7 @@ public class EhvdCommunicationService implements IEhvdCommunication {
*/
@Override
@Nonnull
- public List<String> getRoles(IIdentityLink identityLink) throws AuthenticationException,
+ public EhvdResponseHolder getRoles(IIdentityLink identityLink) throws AuthenticationException,
EAAFBuilderException {
// get bPK for EHVD request
@@ -96,7 +96,7 @@ public class EhvdCommunicationService implements IEhvdCommunication {
final GdaIndexResponse gdaResp = requestingGda(ehvdBpk.getFirst());
// parse roles from response
- return parseGdaResponse(gdaResp);
+ return EhvdResponseHolder.getInstance(gdaResp.getGda(), parseGdaResponse(gdaResp));
}
@@ -287,7 +287,33 @@ public class EhvdCommunicationService implements IEhvdCommunication {
http.getClient().setProxyServerPort(Integer.valueOf(socksPort));
}
-
}
+ public static class EhvdResponseHolder {
+ final List<String> roles;
+ final GdaDescriptor fullGdaResponse;
+
+
+ public static EhvdResponseHolder getInstance(GdaDescriptor gdaInfo, List<String> processedRoles) {
+ return new EhvdResponseHolder(gdaInfo, processedRoles);
+
+ }
+
+ private EhvdResponseHolder(GdaDescriptor gdaInfo, List<String> processedRoles) {
+ this.roles = processedRoles;
+ this.fullGdaResponse = gdaInfo;
+
+ }
+
+ public List<String> getRoles() {
+ return roles;
+ }
+
+ public GdaDescriptor getFullGdaResponse() {
+ return fullGdaResponse;
+ }
+
+
+
+ }
}
diff --git a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/IEhvdCommunication.java b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/IEhvdCommunication.java
index 2d9291ed7..6b7c7e2f5 100644
--- a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/IEhvdCommunication.java
+++ b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/service/IEhvdCommunication.java
@@ -1,10 +1,9 @@
package at.gv.egovernment.moa.id.auth.modules.ehvd.service;
-import java.util.List;
-
import at.gv.egiz.eaaf.core.api.idp.auth.data.IIdentityLink;
import at.gv.egiz.eaaf.core.exceptions.EAAFBuilderException;
import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
+import at.gv.egovernment.moa.id.auth.modules.ehvd.service.EhvdCommunicationService.EhvdResponseHolder;
public interface IEhvdCommunication {
@@ -12,10 +11,10 @@ public interface IEhvdCommunication {
* Get user's GDA roles from EHVD Service.
*
* @param identityLink IdentityLink of the user
- * @return {@link List} of Roles that are received from EHVD
+ * @return {@link EhvdResponseHolder} that contains the Roles received from EHVD and the full GDA response
* @throws AuthenticationException In case of an EHVD communication error
* @throws EAAFBuilderException In case of a bPK generation error
*/
- List<String> getRoles(IIdentityLink identityLink) throws AuthenticationException, EAAFBuilderException;
+ EhvdResponseHolder getRoles(IIdentityLink identityLink) throws AuthenticationException, EAAFBuilderException;
} \ No newline at end of file