Package org.jboss.remoting3.security

Examples of org.jboss.remoting3.security.UserInfo


            if (SecurityActions.remotingContextIsSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                Connection connection = SecurityActions.remotingContextGetConnection();
                UserInfo userInfo = connection.getUserInfo();
                Principal p = null;
                Object credential = null;

                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here


            desiredUser = new SimplePrincipal((String) contextData.get(DELEGATED_USER_KEY));

            Connection con = RemotingContext.getConnection();

            if (con != null) {
                UserInfo userInfo = con.getUserInfo();
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
                    for (Principal current : sinfo.getPrincipals()) {
                        if (current instanceof RealmUser) {
                            connectionUser = (RealmUser) current;
View Full Code Here

    private final Subject subject;

    public RemotingConnectionCredential(final Connection connection) {
        this.connection = connection;
        Subject subject = null;
        UserInfo userInfo = connection.getUserInfo();
        if (userInfo instanceof SubjectUserInfo) {
            subject = ((SubjectUserInfo) userInfo).getSubject();
        }
        this.subject = subject;
    }
View Full Code Here

            boolean authenticated = false;
            if (SecurityActions.remotingContextIsSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                UserInfo userInfo = SecurityActions.remotingContextGetConnection().getUserInfo();
                Principal p = null;
                String credential = null;
                Subject subject = null;
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here

            boolean authenticated = false;
            if (RemotingContext.isSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                UserInfo userInfo = RemotingContext.getConnection().getUserInfo();
                Principal p = null;
                String credential = null;
                Subject subject = null;
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here

            boolean authenticated = false;
            if (RemotingContext.isSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                UserInfo userInfo = RemotingContext.getConnection().getUserInfo();
                Principal p = null;
                String credential = null;
                Subject subject = null;
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here

    }

    @Override
    public void start(final StartContext context) throws StartException {
        try {
            NetworkServerProvider networkServerProvider = endpointValue.getValue().getConnectionProviderInterface("remote", NetworkServerProvider.class);
            RemotingSecurityProvider rsp = securityProviderValue.getValue();
            ServerAuthenticationProvider sap = rsp.getServerAuthenticationProvider();
            OptionMap.Builder builder = OptionMap.builder();
            if (connectorPropertiesOptionMap != null) {
                builder.addAll(connectorPropertiesOptionMap);
            }
            builder.addAll(rsp.getOptionMap());
            streamServer = networkServerProvider.createServer(getSocketAddress(), builder.getMap(), sap, rsp.getXnioSsl());
            SocketBindingManager sbm = socketBindingManagerValue.getOptionalValue();
            if (sbm != null) {
                managedBinding = registerSocketBinding(sbm);
            }
            log.infof("Listening on %s", getSocketAddress());
View Full Code Here

        final Endpoint endpoint = Remoting.createEndpoint(configuration.getEndpointName(), configuration.getOptionMap());

        Registration registration = endpoint.addConnectionProvider(configuration.getUriScheme(), new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE));

        final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface(configuration.getUriScheme(), NetworkServerProvider.class);
        SimpleServerAuthenticationProvider provider = new SimpleServerAuthenticationProvider();
        //There is currently a probable bug in jboss remoting, so the user realm name MUST be the same as
        //the endpoint name.

        provider.addUser("TestUser","localhost.localdomain", "TestUserPassword".toCharArray());
        System.out.println(configuration.getBindAddress());
        OptionMap options = OptionMap.create(Options.SASL_MECHANISMS, Sequence.of("ANONYMOUS"), Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE);
        AcceptingChannel<? extends ConnectedStreamChannel> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), options, provider, null);

        return new ChannelServer(endpoint, registration, streamServer);
    }
View Full Code Here

        final Endpoint endpoint = Remoting.createEndpoint(configuration.getEndpointName(), configuration.getOptionMap());

        Registration registration = endpoint.addConnectionProvider(configuration.getUriScheme(), new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE));

        final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface(configuration.getUriScheme(), NetworkServerProvider.class);
        SimpleServerAuthenticationProvider provider = new SimpleServerAuthenticationProvider();
        //There is currently a probable bug in jboss remoting, so the user realm name MUST be the same as
        //the endpoint name.
        provider.addUser("bob", configuration.getEndpointName(), "pass".toCharArray());
        AcceptingChannel<? extends ConnectedStreamChannel> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), OptionMap.create(Options.SASL_MECHANISMS, Sequence.of("CRAM-MD5")), provider, null);

        return new ChannelServer(endpoint, registration, streamServer);
    }
View Full Code Here

    }

    @Override
    public void start(final StartContext context) throws StartException {
        try {
            NetworkServerProvider networkServerProvider = endpointValue.getValue().getConnectionProviderInterface("remote", NetworkServerProvider.class);
            RemotingSecurityProvider rsp = securityProviderValue.getValue();
            ServerAuthenticationProvider sap = rsp.getServerAuthenticationProvider();
            OptionMap.Builder builder = OptionMap.builder();
            builder.addAll(rsp.getOptionMap());
            if (connectorPropertiesOptionMap != null) {
                builder.addAll(connectorPropertiesOptionMap);
            }
            OptionMap resultingMap = builder.getMap();
            if (log.isTraceEnabled()) {
                log.tracef("Resulting OptionMap %s", resultingMap.toString());
            }
            streamServer = networkServerProvider.createServer(getSocketAddress(), resultingMap, sap, rsp.getXnioSsl());
            SocketBindingManager sbm = socketBindingManagerValue.getOptionalValue();
            if (sbm != null) {
                managedBinding = registerSocketBinding(sbm);
            }
            ROOT_LOGGER.listeningOnSocket(getSocketAddress());
View Full Code Here

TOP

Related Classes of org.jboss.remoting3.security.UserInfo

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.