Creating User in Okta

Hi Team,

I am using Spring Boot to connect to Okta Server.
I am using below OKTA SDK API to store create user.
User user = client.createuser(CreateUserRequest request);

My problem is I am not able to create instance for CreateUserRequest as it is an interface and the implementation class not available in that dependency.
I am posting here this question to know that, is there any sample reference available for building the CreateUserRequest object.

Thank you

Does the example code snippet work for you?

UserApi userApi = new UserApi(client);
User user = UserBuilder.instance()
.setEmail(β€œjoe.coder@example.com”)
.setFirstName(β€œJoe”)
.setLastName(β€œCode”)
.buildAndCreate(userApi);

1 Like