0
を失敗し、次のコードを使用して新しいユーザーを作成してください:Keycloak作成新しいユーザーが
Keycloak kc = Keycloak.getInstance(
"http://192.168.11.55:8080/auth",
"master", // the realm to log in to
"admin", "pass", // the user
"security-admin-console");
CredentialRepresentation credential = new CredentialRepresentation();
credential.setType(CredentialRepresentation.PASSWORD);
credential.setValue("test123");
UserRepresentation user = new UserRepresentation();
user.setUsername("testuser");
user.setFirstName("Test");
user.setLastName("User");
user.setCredentials(Arrays.asList(credential));
kc.realm("master").users().create(user);
それはHTTP 400不正な要求を返します。 Keycloakログは言う:私はKeycloak 2.3.0.FinalとKeycloak管理RESTクライアント2.4.0.FinalのAPIを使用してい
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "origin" (class org.keycloak.representations.idm.UserRepresentation), not marked as ignorable (22 known properties: "federatedIdentities", "enabled", "lastName", "emailVerified", "clientConsents", "self", "socialLinks", "applicationRoles", "createdTimestamp", "groups", "username", "attributes", "id", "firstName", "email", "federationLink", "serviceAccountClientId", "requiredActions", "realmRoles", "clientRoles", "totp", "credentials"])
at [Source: [email protected]; line: 1, column: 37] (through reference chain: org.keycloak.representations.idm.UserRepresentation["origin"])
。
設定にフェデレーションSPIがありますか?これはエラーがどこにあるかのようです。 –