The Create new User operation creates a new sub-group in Keycloak. The data is defined in the input XML expected by the adapter.
Input XML
<?xml version="1.0" encoding="UTF-8"?>
<User>
<Username></Username>
<FirstName></FirstName>
<LastName></LastName>
<Email></Email>
<EmailVerified></EmailVerified>
<Enabled></Enabled>
<Attributes>
<Attribute>
<Name></Name>
<Values>
<Value></Value>
</Values>
</Attribute>
</Attributes>
<Credentials>
<Credential>
<Type></Type>
<Value></Value>
<Temporary></Temporary>
</Credential>
</Credentials>
</User>
User
|
Element |
Description |
Possible values |
|---|---|---|
|
|
|
The element contains the following elements:
|
|
|
The user name requested by the user |
Any string |
|
|
The user's first name |
Any string |
|
|
The user's last name |
Any string |
|
|
The user’s email address. |
Email address |
|
|
Indicates whether the specified email address is verified. |
|
|
|
Indicates whether the user is enabled or disabled. |
|
|
|
Personalized, configurable attributes |
The element contains the following elements:
|
|
|
User credentials |
The element contains the following element:
|
Attributes
|
Element |
Description |
|
|---|---|---|
|
|
Personalized, configurable attributes |
The element contains the following elements:
|
|
|
Personalized, configurable attribute |
The element contains the following elements:
|
|
|
Attribute name |
Any string |
|
|
Attribute values |
The element contains the following elements:
|
|
|
Attribute value |
Any string |
Credentials
The Credentials element specifies the type of login record and its value. This can be a password, for example.
|
Element |
Description |
Possible values |
|---|---|---|
|
|
User credentials |
The element contains the following elements:
|
|
|
Login record |
The element contains the following elements:
|
|
|
Type of login record, such as password |
|
|
|
Attribute value |
Any string |
|
|
Specifies whether the password is temporary. |
|
XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="User">
<xs:complexType>
<xs:sequence>
<xs:element ref="Username"/>
<xs:element ref="FirstName"/>
<xs:element ref="LastName"/>
<xs:element ref="Email"/>
<xs:element ref="EmailVerified"/>
<xs:element ref="Enabled"/>
<xs:element ref="Attributes"/>
<xs:element ref="Credentials"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Username" type="xs:NCName"/>
<xs:element name="FirstName" type="xs:NCName"/>
<xs:element name="LastName" type="xs:NCName"/>
<xs:element name="Email" type="xs:string"/>
<xs:element name="EmailVerified" type="xs:boolean"/>
<xs:element name="Enabled" type="xs:boolean"/>
<xs:element name="Attributes">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Attribute"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Attribute">
<xs:complexType>
<xs:sequence>
<xs:element ref="Name"/>
<xs:element ref="Values"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Values">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Credentials">
<xs:complexType>
<xs:sequence>
<xs:element ref="Credential"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Credential">
<xs:complexType>
<xs:sequence>
<xs:element ref="Type"/>
<xs:element ref="Value"/>
<xs:element ref="Temporary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Type" type="xs:NCName"/>
<xs:element name="Temporary" type="xs:boolean"/>
<xs:element name="Value" type="xs:string"/>
</xs:schema>
Examples
Input
<?xml version="1.0" encoding="UTF-8"?>
<User>
<Username>JohnDoe</Username>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Email>John.Doe@example.com</Email>
<EmailVerified>true</EmailVerified>
<Enabled>true</Enabled>
<Attributes>
<Attribute>
<Name>Employment Relationship</Name>
<Values>
<Value>Software Developer</Value>
<Value>Sub-Team Lead</Value>
</Values>
</Attribute>
</Attributes>
<Credentials>
<Credential>
<Type>password</Type>
<Value>password123</Value>
<Temporary>false</Temporary>
</Credential>
</Credentials>
</User>