private ClientMessage prepareAuthenticatedClientMessage() { Connection connection = endpoint.getConnection(); ILogger logger = clientEngine.getLogger(getClass()); endpoint.authenticated(principal, credentials, isOwnerConnection(), clientVersion, clientMessage.getCorrelationId()); setConnectionType(); logger.info("Received auth from " + connection + ", successfully authenticated" + ", principal: " + principal + ", owner connection: " + isOwnerConnection() + ", client version: " + clientVersion); if (endpointManager.registerEndpoint(endpoint)) { clientEngine.bind(endpoint); } final Address thisAddress = clientEngine.getThisAddress(); byte status = AuthenticationStatus.AUTHENTICATED.getId(); return encodeAuth(status, thisAddress, principal.getUuid(), principal.getOwnerUuid(), serializationService.getVersion(), Collections.<Member>emptyList()); }
private ClientMessage prepareAuthenticatedClientMessage() { Connection connection = endpoint.getConnection(); endpoint.authenticated(principal, credentials, isOwnerConnection(), clientVersion, clientMessage.getCorrelationId(), clientName, attributes); setConnectionType(); logger.info("Received auth from " + connection + ", successfully authenticated" + ", principal: " + principal + ", owner connection: " + isOwnerConnection() + ", client version: " + clientVersion); if (endpointManager.registerEndpoint(endpoint)) { clientEngine.bind(endpoint); } final Address thisAddress = clientEngine.getThisAddress(); byte status = AUTHENTICATED.getId(); return encodeAuth(status, thisAddress, principal.getUuid(), principal.getOwnerUuid(), serializationService.getVersion(), Collections.<Member>emptyList()); }
private boolean doRun() throws Exception { ILogger logger = getLogger(); ClientEngineImpl engine = getService(); String memberUuid = getCallerUuid(); if (!engine.trySetLastAuthenticationCorrelationId(clientUuid, authCorrelationId)) { String message = "Server already processed a newer authentication from client with UUID " + clientUuid + ". Not applying requested ownership change to " + memberUuid; logger.info(message); throw new StubAuthenticationException(message); } Set<ClientEndpoint> endpoints = engine.getEndpointManager().getEndpoints(clientUuid); for (ClientEndpoint endpoint : endpoints) { ClientPrincipal principal = new ClientPrincipal(clientUuid, memberUuid); endpoint.authenticated(principal); } String previousMemberUuid = engine.addOwnershipMapping(clientUuid, memberUuid); if (logger.isFineEnabled()) { logger.fine("Client authenticated " + clientUuid + ", owner " + memberUuid); } return previousMemberUuid == null; }
private boolean doRun() throws Exception { ILogger logger = getLogger(); ClientEngineImpl engine = getService(); String memberUuid = getCallerUuid(); if (!engine.trySetLastAuthenticationCorrelationId(clientUuid, authCorrelationId)) { String message = "Server already processed a newer authentication from client with UUID " + clientUuid + ". Not applying requested ownership change to " + memberUuid; logger.info(message); throw new StubAuthenticationException(message); } Set<ClientEndpoint> endpoints = engine.getEndpointManager().getEndpoints(clientUuid); for (ClientEndpoint endpoint : endpoints) { ClientPrincipal principal = new ClientPrincipal(clientUuid, memberUuid); endpoint.authenticated(principal); } String previousMemberUuid = engine.addOwnershipMapping(clientUuid, memberUuid); if (logger.isFineEnabled()) { logger.fine("Client authenticated " + clientUuid + ", owner " + memberUuid); } return previousMemberUuid == null; }