Interface SimpleAuthOutput

    • Method Detail

      • authenticateSuccessfully

        void authenticateSuccessfully()
        Successfully authenticates the client.

        A CONNACK packet with reason code SUCCESS is sent to the client.

        This is a final decision, authenticators of the next extensions (with lower priority) are not called.

        Throws:
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.0.0, CE 2019.1
      • failAuthentication

        void failAuthentication()
        Fails the authentication of the client.

        A CONNACK packet with reason code NOT_AUTHORIZED and reason string Authentication failed is sent to the client.

        This is a final decision, authenticators of the next extensions (with lower priority) are not called.

        Throws:
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.0.0, CE 2019.1
      • failAuthentication

        void failAuthentication​(@NotNull ConnackReasonCode reasonCode)
        Fails the authentication of the client.

        A CONNACK packet with the specified reason code and reason string Authentication failed is sent to the client.

        This is a final decision, authenticators of the next extensions (with lower priority) are not called.

        Parameters:
        reasonCode - The reason code of the CONNACK packet.
        Throws:
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.3.0, CE 2020.1
      • failAuthentication

        void failAuthentication​(@Nullable String reasonString)
        Fails the authentication of the client.

        A CONNACK packet with reason code NOT_AUTHORIZED and the specified reason string is sent to the client.

        This is a final decision, authenticators of the next extensions (with lower priority) are not called.

        Parameters:
        reasonString - Used as the reason string in the CONNACK packet.
        Throws:
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.0.0, CE 2019.1
      • failAuthentication

        void failAuthentication​(@NotNull ConnackReasonCode reasonCode,
                                @Nullable String reasonString)
        Fails the authentication of the client.

        A CONNACK packet with the specified reason code and reason string is sent to the client.

        This is a final decision, authenticators of the next extensions (with lower priority) are not called.

        Parameters:
        reasonCode - Used as the reason code in the CONNACK packet.
        reasonString - Used as the reason string in the CONNACK packet.
        Throws:
        IllegalArgumentException - If the reasonCode is SUCCESS.
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.0.0, CE 2019.1
      • nextExtensionOrDefault

        void nextExtensionOrDefault()
        The outcome of the authentication is determined by an authenticator of the next extension (with lower priority).

        If no extension with an authenticator is left the default behaviour is used. The default behaviour is the same as failAuthentication().

        Throws:
        UnsupportedOperationException - When authenticateSuccessfully, failAuthentication or nextExtensionOrDefault has already been called.
        Since:
        4.0.0, CE 2019.1