diff options
8 files changed, 22 insertions, 18 deletions
| diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java index 409e506af..842c06f15 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java @@ -126,7 +126,7 @@ public class AttributeCollector implements IAction {                  for (AttributeProvider currentProvider : AttributeProviderFactory.getConfiguredPlugins(oaParam.getStorkAPs())) {                      try {                          // - hand over control to the suitable plugin -                        aquiredAttributes = currentProvider.acquire(currentAttribute, moasession); +                        aquiredAttributes = currentProvider.acquire(currentAttribute, container.getRequest().getSpCountry(), moasession);                          break;                      } catch (UnsupportedAttributeException e) {                          // ok, try the next attributeprovider @@ -163,7 +163,7 @@ public class AttributeCollector implements IAction {                  AssertionStorage.getInstance().put(newArtifactId, container);                  // add container-key to redirect embedded within the return URL -                e.getAp().performRedirect(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/ResumeAuthentication?" + ARTIFACT_ID + "=" + newArtifactId, container.getRequest().getSpCountry(), request, response, oaParam); +                e.getAp().performRedirect(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/ResumeAuthentication?" + ARTIFACT_ID + "=" + newArtifactId, request, response, oaParam);              } catch (Exception e1) {                  // TODO should we return the response as is to the PEPS? diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java index d92b0b72f..2914d8f7d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java @@ -22,25 +22,25 @@ public interface AttributeProvider {  	 * the response.  	 *  	 * @param attributes the list of attributes to be acquired +	 * @param spCountyCode the sp county code  	 * @param moasession the moasession  	 * @return the personal attribute  	 * @throws UnsupportedAttributeException the unsupported attribute exception  	 * @throws ExternalAttributeRequestRequiredException an attribute request to an external service has to be done  	 * @throws MOAIDException the mOAID exception  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attributes, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException; +	public IPersonalAttributeList acquire(PersonalAttribute attributes, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException;  	/**  	 * Perform redirect.  	 *  	 * @param url the return URL ending with ?artifactId=... -	 * @param spCountyCode the sp county code  	 * @param req the request we got from the S-PEPS and for which we have to ask our APs  	 * @param resp the response to the preceding request  	 * @param oaParam the oa param  	 * @throws MOAIDException the mOAID exception  	 */ -	public void performRedirect(String url, String spCountyCode, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException; +	public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException;  	/**  	 * Parses the response we got from the external attribute provider. diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java index 9c0869d97..56120cba2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoNoRedirectAttributeProvider.java @@ -20,7 +20,7 @@ public class DemoNoRedirectAttributeProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java.lang.String)  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attributeName, AuthenticationSession moasession) +	public IPersonalAttributeList acquire(PersonalAttribute attributeName, String spCountyCode, AuthenticationSession moasession)  			throws UnsupportedAttributeException {  		PersonalAttributeList requestedAttributes = new PersonalAttributeList(1);  		requestedAttributes.add(new PersonalAttribute("sepp", true, new ArrayList<String>(), "")); @@ -38,7 +38,7 @@ public class DemoNoRedirectAttributeProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)  	 */ -	public void performRedirect(String url, String citizenCountyCode, +	public void performRedirect(String url,   			HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) {  		// we should not get here  	} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java index 26fc00406..aaba87c6c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DemoRedirectAttributeProvider.java @@ -20,7 +20,7 @@ public class DemoRedirectAttributeProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java.lang.String)  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attributeName, AuthenticationSession moasession) +	public IPersonalAttributeList acquire(PersonalAttribute attributeName, String spCountyCode, AuthenticationSession moasession)  			throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException {  		throw new ExternalAttributeRequestRequiredException(this);  	} @@ -37,7 +37,7 @@ public class DemoRedirectAttributeProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)  	 */ -	public void performRedirect(String url, String citizenCountyCode, +	public void performRedirect(String url,   			HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) {  		// we should not get here diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java index 1b951c4ff..02ae5fd62 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java @@ -62,7 +62,7 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(eu.stork.peps.auth.commons.PersonalAttribute)  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attribute, AuthenticationSession moasession) +	public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountryCode, AuthenticationSession moasession)  			throws UnsupportedAttributeException,  			ExternalAttributeRequestRequiredException, MOAIDException { @@ -211,7 +211,7 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {  			// add stork id for verification  			ArrayList<String> value = new ArrayList<String>(); -			value.add(new BPKBuilder().buildStorkbPK(moasession.getIdentityLink().getIdentificationValue(), "IT")); +			value.add(new BPKBuilder().buildStorkbPK(moasession.getIdentityLink().getIdentificationValue(), spCountryCode));  			result.add(new PersonalAttribute("eIdentifier", false, value, "Available")); @@ -224,7 +224,7 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.config.auth.OAAuthParameter)  	 */ -	public void performRedirect(String url, String spCountyCode, +	public void performRedirect(String url,  			HttpServletRequest req, HttpServletResponse resp,  			OAAuthParameter oaParam) throws MOAIDException {  		// there is no redirect required diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MISAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MISAttributeProvider.java index ec38db513..9492159e3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MISAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MISAttributeProvider.java @@ -21,7 +21,7 @@ public class MISAttributeProvider implements AttributeProvider {          this.url = url;      } -    public IPersonalAttributeList acquire(PersonalAttribute attributes, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException { +    public IPersonalAttributeList acquire(PersonalAttribute attributes, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException {          Logger.error("Entering MIS for attribute: " + attributes.getName());          if (attributes.getName().equals("residencePermit")) { @@ -32,7 +32,7 @@ public class MISAttributeProvider implements AttributeProvider {          return null;  //      } -    public void performRedirect(String url, String citizenCountyCode, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException { +    public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException {          Logger.error("Entering MIS redirect for attribute: " );      } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java index 6a8e306a1..59b4f386f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java @@ -59,7 +59,7 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider {  	 * at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java  	 * .lang.String)  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attribute, AuthenticationSession moasession) throws UnsupportedAttributeException, +	public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException,  			ExternalAttributeRequestRequiredException {  		if(!attribute.getName().equals("signedDoc")){  			throw new UnsupportedAttributeException(); @@ -108,7 +108,7 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider {  	 * at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect  	 * (java.lang.String)  	 */ -	public void performRedirect(String url, String citizenCountryCode, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) +	public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam)  			throws MOAIDException {  		try { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java index d8becaaf7..2b946b167 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java @@ -38,6 +38,8 @@ public class StorkAttributeRequestProvider implements AttributeProvider {  	/** The attributes. */  	private String attributes; +	private String spCountryCode; +  	/**  	 * Instantiates a new stork attribute request provider.  	 * @@ -52,11 +54,13 @@ public class StorkAttributeRequestProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java.lang.String)  	 */ -	public IPersonalAttributeList acquire(PersonalAttribute attribute, AuthenticationSession moasession) +	public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountyCode, AuthenticationSession moasession)  			throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException {  		if (!attributes.contains(attribute.getName()))  			throw new UnsupportedAttributeException(); +		 +		this.spCountryCode = spCountyCode;  		requestedAttributes = new PersonalAttributeList(1);  		requestedAttributes.add(attribute); @@ -98,7 +102,7 @@ public class StorkAttributeRequestProvider implements AttributeProvider {  	/* (non-Javadoc)  	 * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String)  	 */ -	public void performRedirect(String url, String spCountryCode, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException { +	public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException {      	String spSector = "Business";      	String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName(); | 
