Package com.hazelcast.security

Examples of com.hazelcast.security.UsernamePasswordCredentials


            authenticated = false;
            logger.severe("Could not retrieve Credentials object!");
        } else if (clientEngine.getSecurityContext() != null) {
            authenticated = authenticate(clientEngine.getSecurityContext());
        } else if (credentials instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials;
            authenticated = authenticate(usernamePasswordCredentials);
        } else {
            authenticated = false;
            logger.severe("Hazelcast security is disabled.\nUsernamePasswordCredentials or cluster "
                    + "group-name and group-password should be used for authentication!\n"
View Full Code Here


                    throw ExceptionUtil.rethrow(e);
                }
            }
        }
        if (c == null) {
            c = new UsernamePasswordCredentials(groupConfig.getName(), groupConfig.getPassword());
        }

        this.smartRouting = networkConfig.isSmartRouting();
        this.executionService = (ClientExecutionServiceImpl) client.getClientExecutionService();
        this.credentials = c;
View Full Code Here

    public PortableFactory createFactory() {
        return new PortableFactory() {
            public Portable create(int classId) {
                switch (classId){
                    case USERNAME_PWD_CRED:
                        return new UsernamePasswordCredentials();
                    case COLLECTION:
                        return new PortableCollection();
                    case ITEM_EVENT:
                        return new PortableItemEvent();
                    case ENTRY_EVENT:
View Full Code Here

        }

        final String credentials = Configuration.getProperty(prefix + "credentials", null);
        if (credentials != null) {
            final String[] segments = credentials.split(":");
            config.setCredentials(new UsernamePasswordCredentials(segments[0], segments[1]));
        }

        return HazelcastClient.newHazelcastClient(config);
    }
View Full Code Here

            authenticated = false;
            logger.severe("Could not retrieve Credentials object!");
        } else if (clientEngine.getSecurityContext() != null) {
            authenticated = authenticate(clientEngine.getSecurityContext());
        } else if (credentials instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials;
            authenticated = authenticate(usernamePasswordCredentials);
        } else {
            authenticated = false;
            logger.severe("Hazelcast security is disabled.\nUsernamePasswordCredentials or cluster "
                    + "group-name and group-password should be used for authentication!\n"
View Full Code Here

    public PortableFactory createFactory() {
        return new PortableFactory() {
            public Portable create(int classId) {
                switch (classId) {
                    case USERNAME_PWD_CRED:
                        return new UsernamePasswordCredentials();
                    case COLLECTION:
                        return new PortableCollection();
                    case ITEM_EVENT:
                        return new PortableItemEvent();
                    case ENTRY_EVENT:
View Full Code Here

                    throw ExceptionUtil.rethrow(e);
                }
            }
        }
        if (c == null) {
            c = new UsernamePasswordCredentials(groupConfig.getName(), groupConfig.getPassword());
        }
        return c;
    }
View Full Code Here

    public void auth() throws IOException {
        //we need to call this so that the endpoint is created for the connection. Normally this is done from
        //the ConnectionManager.
        clientEngine.getConnectionListener().connectionAdded(connection);
        AuthenticationRequest auth = new AuthenticationRequest(new UsernamePasswordCredentials("dev", "dev-pass"));
        auth.setOwnerConnection(true);
        send(auth);
        receive();
    }
View Full Code Here

        in = serializationService.createObjectDataInputStream(new BufferedInputStream(socket.getInputStream()));
        out = serializationService.createObjectDataOutputStream(new BufferedOutputStream(outputStream));
    }

    public void auth() throws IOException {
        AuthenticationRequest auth = new AuthenticationRequest(new UsernamePasswordCredentials("dev", "dev-pass"));
        send(auth);
        receive();
    }
View Full Code Here

    @Test
    public void testPacket_writeAndRead() {
        SerializationService ss = createSerializationService(10);

        UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("test", "pass");
        ClientPrincipal principal = new ClientPrincipal("uuid", "uuid2");
        Data data = ss.toData(new AuthenticationRequest(credentials, principal));

        Packet packet = new Packet(data, ss.getPortableContext());
        ByteBuffer buffer = ByteBuffer.allocate(1024);
View Full Code Here

TOP

Related Classes of com.hazelcast.security.UsernamePasswordCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.