Class GrpcAuthenticationService

java.lang.Object
org.saidone.unrest.api.AuthenticationServiceGrpc.AuthenticationServiceImplBase
org.saidone.unrest.platform.GrpcAuthenticationService
All Implemented Interfaces:
io.grpc.BindableService, org.saidone.unrest.api.AuthenticationServiceGrpc.AsyncService

public final class GrpcAuthenticationService extends org.saidone.unrest.api.AuthenticationServiceGrpc.AuthenticationServiceImplBase
Exchanges Alfresco credentials for a ticket and handles validation and revocation of the presented ticket.

Credential authentication is the only operation allowed without an existing alfresco-ticket header. It combines Alfresco authentication and retrieval of the current ticket in one RPC. The previous thread-local authentication is restored on both success and failure; authentication does not remain attached to the gRPC worker thread.

Subsequent repository calls must send the returned ticket to TicketInterceptor.

See Also:
  • AuthenticationService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    authenticate(org.saidone.unrest.api.LoginRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.LoginResponse> observer)
    Authenticates credentials and retrieves the current Alfresco ticket in the same call.
    void
    invalidateTicket(org.saidone.unrest.api.TicketRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.InvalidateTicketResponse> observer)
     
    void
    validateTicket(org.saidone.unrest.api.TicketRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.LoginResponse> observer)
    Uses the ticket supplied in alfresco-ticket metadata.

    Methods inherited from class org.saidone.unrest.api.AuthenticationServiceGrpc.AuthenticationServiceImplBase

    bindService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GrpcAuthenticationService

      public GrpcAuthenticationService()
  • Method Details

    • authenticate

      public void authenticate(org.saidone.unrest.api.LoginRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.LoginResponse> observer)
      Authenticates credentials and retrieves the current Alfresco ticket in the same call. Blank credentials yield INVALID_ARGUMENT, rejected credentials yield UNAUTHENTICATED, and unexpected failures yield INTERNAL.

      No existing ticket is required. The previous thread authentication is restored before the successful response is emitted.

      Parameters:
      request - required username and password
      observer - receives one repository ticket on success, or the corresponding gRPC error
    • validateTicket

      public void validateTicket(org.saidone.unrest.api.TicketRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.LoginResponse> observer)
      Description copied from interface: org.saidone.unrest.api.AuthenticationServiceGrpc.AsyncService
       Uses the ticket supplied in alfresco-ticket metadata.
       
    • invalidateTicket

      public void invalidateTicket(org.saidone.unrest.api.TicketRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.InvalidateTicketResponse> observer)