Package org.saidone.unrest.platform
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(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.voidinvalidateTicket(org.saidone.unrest.api.TicketRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.InvalidateTicketResponse> observer) voidvalidateTicket(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
-
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 yieldINVALID_ARGUMENT, rejected credentials yieldUNAUTHENTICATED, and unexpected failures yieldINTERNAL.No existing ticket is required. The previous thread authentication is restored before the successful response is emitted.
- Parameters:
request- required username and passwordobserver- 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.AsyncServiceUses 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)
-