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);