本文整理匯總了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);
}
示例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);
}
示例3: IdmEventMapper
import org.keycloak.models.UserProvider; //導入依賴的package包/類
IdmEventMapper(RealmProvider realmProvider, UserProvider userProvider, ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
this.realmProvider = realmProvider;
this.userProvider = userProvider;
}