public void login() throws UserStoreException { String userName = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.USER_NAME); String password = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.PASSWORD); try { ConfigurationContext configContext = (ConfigurationContext) UserMgtWSAPIDSComponent .getCcServiceInstance().getClientConfigContext(); AuthenticationAdminClient client = new AuthenticationAdminClient(configContext, realmConfig.getRealmProperty(WSRemoteUserMgtConstants.SERVER_URL), sessionCookie, null, false); boolean isLogin = client.login(userName, password, "127.0.0.1"); // TODO if (isLogin) { sessionCookie = client.getAdminCookie(); } } catch (Exception e) { throw new UserStoreException("Error" + e.getMessage(), e); } }
public void login() throws UserStoreException { String userName = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.USER_NAME); String password = realmConfig.getRealmProperty(WSRemoteUserMgtConstants.PASSWORD); try { ConfigurationContext configContext = UserMgtWSAPIDSComponent .getCcServiceInstance().getClientConfigContext(); AuthenticationAdminClient client = new AuthenticationAdminClient(configContext, realmConfig.getRealmProperty(WSRemoteUserMgtConstants.SERVER_URL), UserMgtWSAPIDataHolder.getInstance().getSessionCookie(), null, false); boolean isLogin = client.login(userName, password, DEFAULT_LOCAL_IP); if (isLogin) { UserMgtWSAPIDataHolder.getInstance().setSessionCookie(client.getAdminCookie()); } } catch (Exception e) { throw new UserStoreException(LOGIN_ERROR_MESSAGE + e.getMessage(), e); } }
/** * Initialize WSRealm by Non-carbon environment * */ public void init(RealmConfiguration configBean, ConfigurationContext configCtxt) throws UserStoreException { realmConfig = configBean; if (sessionCookie == null) { synchronized (WSRealm.class) { if (sessionCookie == null) { login(); } } } if (sessionCookie == null) { throw new UserStoreException("Cannot create session for WSRealm"); } init((String) realmConfig.getRealmProperty(WSRemoteUserMgtConstants.SERVER_URL), sessionCookie, configCtxt); }
userRealmInfo.setDomainNames(domainNames.toArray(new String[domainNames.size()])); String itemsPerPageString = realmConfig.getRealmProperty("MaxItemsPerUserMgtUIPage"); int itemsPerPage = 15; try { String maxPageInCacheString = realmConfig.getRealmProperty("MaxUserMgtUIPagesInCache"); int maxPagesInCache = 6; try { String enableUIPageCacheString = realmConfig.getRealmProperty("EnableUserMgtUIPageCache"); boolean enableUIPageCache = true; if (FALSE.equals(enableUIPageCacheString)) {
userRealmInfo.setDomainNames(domainNames.toArray(new String[domainNames.size()])); String itemsPerPageString = realmConfig.getRealmProperty("MaxItemsPerUserMgtUIPage"); int itemsPerPage = 15; try { String maxPageInCacheString = realmConfig.getRealmProperty("MaxUserMgtUIPagesInCache"); int maxPagesInCache = 6; try { String enableUIPageCacheString = realmConfig.getRealmProperty("EnableUserMgtUIPageCache"); boolean enableUIPageCache = true; if (FALSE.equals(enableUIPageCacheString)) {
/** * Initialize WSRealm by Non-carbon environment */ public void init(RealmConfiguration configBean, ConfigurationContext configCtxt) throws UserStoreException { realmConfig = configBean; if (UserMgtWSAPIDataHolder.getInstance().getSessionCookie() == null) { synchronized (WSRealm.class) { if (UserMgtWSAPIDataHolder.getInstance().getSessionCookie() == null) { login(); } } } if (UserMgtWSAPIDataHolder.getInstance().getSessionCookie() == null) { throw new UserStoreException(REALM_CREATION_ERROR_MESSAGE); } init((String) realmConfig.getRealmProperty(WSRemoteUserMgtConstants.SERVER_URL), UserMgtWSAPIDataHolder.getInstance().getSessionCookie(), configCtxt); }