Interface SecuredService


  • public interface SecuredService

    Interface, that implement cross-cutting security concerns for Lagom services.

    More information about service call composition in Lagom documentation.

    Since:
    1.0.0
    Author:
    Sergey Morgunov
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authenticate​(String clientName, Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authentication.
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authenticate​(Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authentication.
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authorize​(String clientName, String authorizerName, Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authorization.
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authorize​(String authorizerName, Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authorization.
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authorize​(String clientName, Authorizer<CommonProfile> authorizer, Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authorization.
      default <Request,​Response>
      com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>
      authorize​(Authorizer<CommonProfile> authorizer, Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
      Service call composition for authorization.
      Config getSecurityConfig()
      Get configuration of pac4j for this service.
    • Method Detail

      • getSecurityConfig

        Config getSecurityConfig()
        Get configuration of pac4j for this service.
        Returns:
        pac4j configuration
      • authenticate

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authenticate​(Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authentication.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        serviceCall - Service call
        Returns:
        Service call with authentication logic
      • authenticate

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authenticate​(String clientName,
                                                                                                                                   Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authentication.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        clientName - Name of authentication client
        serviceCall - Service call
        Returns:
        Service call with authentication logic
      • authorize

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authorize​(Authorizer<CommonProfile> authorizer,
                                                                                                                                Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authorization.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        authorizer - Authorizer (may be composite)
        serviceCall - Service call
        Returns:
        Service call with authorization logic
      • authorize

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authorize​(String clientName,
                                                                                                                                Authorizer<CommonProfile> authorizer,
                                                                                                                                Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authorization.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        clientName - Name of authentication client
        authorizer - Authorizer (may be composite)
        serviceCall - Service call
        Returns:
        Service call with authorization logic
      • authorize

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authorize​(String authorizerName,
                                                                                                                                Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authorization.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        authorizerName - Name of authorizer, registered in security config
        serviceCall - Service call
        Returns:
        Service call with authorization logic
      • authorize

        default <Request,​Response> com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response> authorize​(String clientName,
                                                                                                                                String authorizerName,
                                                                                                                                Function<CommonProfile,​com.lightbend.lagom.javadsl.server.ServerServiceCall<Request,​Response>> serviceCall)
        Service call composition for authorization.
        Type Parameters:
        Request - Type of request
        Response - Type of response
        Parameters:
        clientName - Name of authentication client
        authorizerName - Name of authorizer, registered in security config
        serviceCall - Service call
        Returns:
        Service call with authorization logic