當前位置: 首頁>>代碼示例>>Java>>正文


Java UserProvider類代碼示例

本文整理匯總了Java中org.keycloak.models.UserProvider的典型用法代碼示例。如果您正苦於以下問題:Java UserProvider類的具體用法?Java UserProvider怎麽用?Java UserProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UserProvider類屬於org.keycloak.models包,在下文中一共展示了UserProvider類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import org.keycloak.models.UserProvider; //導入依賴的package包/類
@Before
public void setup() {
    keycloakSession = mock(KeycloakSession.class);
    KeycloakTransactionManager txnManager = mock(KeycloakTransactionManager.class);
    when(keycloakSession.getTransactionManager()).thenReturn(txnManager);
    RealmProvider realms = mock(RealmProvider.class);
    when(keycloakSession.realms()).thenReturn(realms);
    RealmModel realm = mock(RealmModel.class);
    when(realms.getRealmByName(eq("realm"))).thenReturn(realm);
    UserProvider userProvider = mock(UserProvider.class);
    UserModel user = mock(UserModel.class);
    when(userProvider.getUserByUsername(eq("user"), eq(realm))).thenReturn(user);
    when(keycloakSession.userStorageManager()).thenReturn(userProvider);
    UserCredentialManager userCredentialManager = mock(UserCredentialManager.class);
    when(keycloakSession.userCredentialManager()).thenReturn(userCredentialManager);
    when(userCredentialManager.isValid(eq(realm), eq(user), argThat(new PasswordCredentialMatcher("password")))).thenReturn(true);

    config = mock(Config.Scope.class);
}
 
開發者ID:EnMasseProject,項目名稱:enmasse,代碼行數:20,代碼來源:PlainSaslServerMechanismTest.java

示例2: ensureInitialized

import org.keycloak.models.UserProvider; //導入依賴的package包/類
private void ensureInitialized() {

		if (this.idmEventMapper != null) {
			return;
		}

		LOG.tracev("Initializing: component={0}", Utils.toComponentIdString(this));

		RealmProvider realmProvider = keycloakSession.getProvider(RealmProvider.class);
		UserProvider userProvider = keycloakSession.getProvider(UserProvider.class);

		this.idmEventMapper = new IdmEventMapper(realmProvider, userProvider, OBJECT_MAPPER);
		this.idmEventPublisher = new IdmEventPublisher(OBJECT_MAPPER);
	}
 
開發者ID:jugsaar,項目名稱:visit-yajug-20161023-keycloak,代碼行數:15,代碼來源:ForwardingEventListenerProvider.java

示例3: IdmEventMapper

import org.keycloak.models.UserProvider; //導入依賴的package包/類
IdmEventMapper(RealmProvider realmProvider, UserProvider userProvider, ObjectMapper objectMapper) {
	this.objectMapper = objectMapper;
	this.realmProvider = realmProvider;
	this.userProvider = userProvider;
}
 
開發者ID:jugsaar,項目名稱:visit-yajug-20161023-keycloak,代碼行數:6,代碼來源:IdmEventMapper.java


注:本文中的org.keycloak.models.UserProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。