<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z000075vCMGCA2Okta Classic EngineLifecycle ManagementAnswered2021-08-02T13:01:24.000Z2021-07-30T10:05:07.000Z2021-08-02T13:01:24.000Z
  • User16031265193733863689 (Developer Support)

    Hi Shubham,

    It looks like our management SDK lets you create a user with all the supported hashes except MD5. In this case you will need to use the ExtensibleResource.class to create the call.

     

     

    // https://developer.okta.com/docs/reference/api/users/#create-user-with-imported-hashed-password

    // https://developer.okta.com/docs/reference/api/users/#hashed-password-object

    ExtensibleResource resource = client.instantiate(ExtensibleResource.class);

     

    ExtensibleResource profile = client.instantiate(ExtensibleResource.class);

    profile.put("firstName", "md5");

    profile.put("lastName", "hash");

    profile.put("email", "md5.hash@mail.com");

    profile.put("login", "md5.hash@mail.com");

     

    ExtensibleResource credentials = client.instantiate(ExtensibleResource.class);

    ExtensibleResource password = client.instantiate(ExtensibleResource.class);

    ExtensibleResource hash = client.instantiate(ExtensibleResource.class);

    hash.put("algorithm", "MD5");

    hash.put("value", "ZYYtOxuDsffBEdh5SmzhcQ=="); //password is "test password"

    hash.put("salt", "0Sf3Vvq54d0=");

    hash.put("saltOrder", "POSTFIX");

    password.put("hash", hash);

    credentials.put("password", password);

     

    resource.put("credentials", credentials);

    resource.put("profile", profile);

    ExtensibleResource result = client.http()

    .setBody(resource)

    .post("/api/v1/users?activate=true", ExtensibleResource.class);

     

     

    Expand Post
This question is closed.
Loading
User migration with MD5 encrypted password through Okta Java SDK
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply