Package ru.runa.af.service.impl.interfaces

Examples of ru.runa.af.service.impl.interfaces.AuthenticationService


        Hashtable<String, String> environment = new Hashtable<String, String>();
        environment.put(Context.INITIAL_CONTEXT_FACTORY, getResources().getInitialCtxFactory());
        environment.put(Context.URL_PKG_PREFIXES, getResources().getUrlPkgPrefixes());
        environment.put(Context.PROVIDER_URL, getResources().getProviderUrl());
        remoteContext = new InitialContext(environment);
        AuthenticationService service = getService(AuthenticationServiceHome.JNDI_NAME, AuthenticationServiceHome.class);
        if (SyncResources.LOGIN_MODE_LOGIN_PASSWORD.equals(getResources().getLoginMode())) {
            subject = service.authenticate(getResources().getLogin(), getResources().getPassword());
        } else {
            GSSManager manager = GSSManager.getInstance();
            GSSCredential clientCred = manager.createCredential(GSSCredential.INITIATE_ONLY);
            GSSName peerName = manager.createName("WFServer", null);
            GSSContext context = manager.createContext(peerName, (Oid) null, clientCred, GSSContext.DEFAULT_LIFETIME);
            context.requestMutualAuth(false);

            byte[] token = new byte[0];
            token = context.initSecContext(token, 0, token.length);
            subject = service.authenticate(token);
        }
    }
View Full Code Here


        Hashtable<String, String> environment = new Hashtable<String, String>();
        environment.put(Context.INITIAL_CONTEXT_FACTORY, getResources().getInitialCtxFactory());
        environment.put(Context.URL_PKG_PREFIXES, getResources().getUrlPkgPrefixes());
        environment.put(Context.PROVIDER_URL, getResources().getProviderUrl());
        remoteContext = new InitialContext(environment);
        AuthenticationService service = getService(AuthenticationServiceHome.JNDI_NAME, AuthenticationServiceHome.class);
        if (SyncResources.LOGIN_MODE_LOGIN_PASSWORD.equals(getResources().getLoginMode())) {
            subject = service.authenticate(getResources().getLogin(), getResources().getPassword());
        } else {
            GSSManager manager = GSSManager.getInstance();
            GSSCredential clientCred = manager.createCredential(GSSCredential.INITIATE_ONLY);
            GSSName peerName = manager.createName("WFServer", null);
            GSSContext context = manager.createContext(peerName, (Oid) null, clientCred, GSSContext.DEFAULT_LIFETIME);
            context.requestMutualAuth(false);

            byte[] token = new byte[0];
            token = context.initSecContext(token, 0, token.length);
            subject = service.authenticate(token);
        }
    }
View Full Code Here

TOP

Related Classes of ru.runa.af.service.impl.interfaces.AuthenticationService

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.