package at.gv.egovernment.moa.id.auth.validator; import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams; import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; /** * Validates an InfoboxReadResponse. * An implementing class has to validate the content of the InfoboxReadResponse * according to the type specific rules and guidelines of the underlying * application. * If validation succeeds, the class may provide an array of * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute * ExtendedSAMLAttributes}. Each of these SAML-Attributes will be either appended to the * final SAML-Assertion passed to the online application or to the AUTH-Block, * or to both. *
* If validation fails the implementing class has to provide a short error message. */ public interface InfoboxValidator { /** * This method validates an InfoboxReadResponse. * The method validates the content of the passed infoboxReadResponse * according to the type specific rules and guidelines of the underlying * application. *
* The method returns true if validation succeeds. In that case * method {@link #getExtendedSamlAttributes()} may provide an array of * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute * ExtendedSAMLAttributes} that should be appended to the final SAML-Assertion or the * AUTH-Block or to both. *
* The method returns false if validation fails. In that case * method {@link #getErrorMessage()} has to provide a short error description. * * @param params {@link at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams * Parameters} needed by the validator. * * @return True if validation succeeds, * otherwise false. * * @throws ValidateException If an error occurs on validating the * InfoboxReadResponse. */ public boolean validate (InfoboxValidatorParams params) throws ValidateException; /** * Returns an array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute * ExtendedSAMLAttributes} that should be added to the SAML-Assertion * provided to the online application. * The SAML-Attributes in that array will be added to the final * SAML-Assertion, the AUTH-Block, or both, exactly in the order as they are arranged * in the array this method returns. * * @return An array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute * ExtendedSAMLAttributes} that should be added to the SAML-Assertion * provided to the online application, the AUTH-Block, or both. If no attributes should * be added this array maybe null or empty. */ public ExtendedSAMLAttribute[] getExtendedSamlAttributes(); /** * A short error description that should be displayed by MOA-ID if * validation of the InfoBoxReadResponse fails. * * @return An short error message if validation fails. */ public String getErrorMessage(); }