package at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes; import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.AuthenticationData; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.PVP2Exception; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.UnprovideableAttributeException; public class EIDSourcePIN extends BaseAttributeBuilder { public String getName() { return EID_SOURCE_PIN_NAME; } public Attribute build(AuthenticationSession authSession, OAAuthParameter oaParam, AuthenticationData authData) throws PVP2Exception { if (oaParam.getBusinessService()) throw new UnprovideableAttributeException(EID_SOURCE_PIN_NAME); else { return buildStringAttribute(EID_SOURCE_PIN_FRIENDLY_NAME, EID_SOURCE_PIN_NAME, authData.getIdentificationValue()); } } public Attribute buildEmpty() { return buildemptyAttribute(EID_SOURCE_PIN_FRIENDLY_NAME, EID_SOURCE_PIN_NAME); } }