Skip to content

MultipleHAMTests - Create tests for Multiple HAMs with no qualifiers #33953

@TheoGkoumas

Description

@TheoGkoumas
  • Simple testing strategy as need to test the most likely and applicable scenarios, and separate testing of multiple HAMs with and without qualifiers (there are no HAMs with qualifiers being tested in this section).
  • Testing 3 application provided HAMs, ensuring @Priority is considered.
  • Testing 3 in-built HAMs (like Form, Basic, etc ...) ensuring documented priority is considered - Oidc/Custom Form/Form/Basic (although just Form and Basic would suffice).
  • Testing 1 application and 1 in-built HAM and ensuring application HAM is prioritized (application HAM always prioritised over in-built HAM).
  • Testing log file output for multiple HAM resolution, a clear info message showing which HAM was selected.
  • Testing log file output to ensure a clear info message showing which HAMHandler was selected (it will be the in-built one of course).
  • Testing log file output to make sure no unexpected error messages are output.
  • Negative testing:
    • conditions for raising AmbiguousResolutionException (including log file message) - this is done by having two custom HAMs with the same @Priority values.

Test class name: MultipleHAMTests

Implementation

For custom HttpAuthenticationMechanismHandler (HAMHandler), just create a public class in the application with the signature:

@Default
@ApplicationScoped
public class CustomHAMHandler implements HttpAuthenticationMechanismHandler {

    @Override
    public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) {
}

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions