PasswordImport hook is not supported in version 0.1.0 okta-hooks-sdk-java

Hello,

I was trying out this SDK GitHub - okta/okta-hooks-sdk-java: Okta Hooks SDK for Java which is really awesome. However, find out PasswordImport is not supported in the version 0.1.0. Is there a release version is available with the support for PasswordImport hook?
Or is there another SDK that we have to use here?
Thanks
Vinny

Hello,
There is password hook support.
I have never tested it but the implementation looks like all you need to do is either passwordImportVerified() or passwordImportUnverified() for the return.
The small sample here show a Controller that accepts a RequestBody for a user registration. You could use the same code for a password hook and just change the return type depending on if the password matches, for example:

return Hooks.builder()
                .passwordImport(passwordImportVerified())
                .build();

Let us know if you run into any issues.

Thanks a lot for the prompt response. Can you hare the version you are using here? I am finding 0.1.0 as the latest version and not able to find it. Is there another version available?

0.1.0 is currently the only version. The GH repository does not show a sample of the password import hook, and I realize the one I supplied was mistyped. Should have been,

return Hooks.builder()
     .passwordImport(verified())
     .build();

I have cloned repository and modified the sample application with the password import hook. The sample app can be found here.

git clone https://github.com/emanor-okta/okta-hooks-sdk-java
cd okta-hooks-sdk-java/examples/spring-boot
run the sample

The endpoint will be http://localhost:8080/pass-import assuming you don’t change the port.
Running the following Curl command should return a verified.

curl --location --request POST 'http://localhost:8080/pass-import' \
--header 'Content-Type: application/json' \
--data-raw '{
  "eventId": "3o9jBzq1SmOGmmsDsqyyeQ",
  "eventTime": "2020-01-17T21:23:56.000Z",
  "eventType": "com.okta.user.credential.password.import",
  "eventTypeVersion": "1.0",
  "contentType": "application/json",
  "cloudEventVersion": "0.1",
  "source": "https://${yourOktaDomain}/api/v1/inlineHooks/cal2xd5phv9fsPLcF0g7",
  "data": {
    "context": {
      "request": {
        "id": "XiIl6wn7005Rr@fjYqeC7AAABxw",
        "method": "POST",
        "url": {
          "value": "/api/v1/authn"
        },
        "ipAddress": "98.124.153.138"
      },
      "credential": {
        "username": "isaac.brock@example.com",
        "password": "Okta"
      }
    },
    "action": {
      "credential": "UNVERIFIED"
    }
  }
}'

Thanks, Erik. Sounds like we either need to fork the project a build a new version with the password import hook and use that as a dependency or copy the source code to our project. Do you know when a newer version will be available? Any reason not release the passwordimport hook changes? Thanks again for helping us here.

I don’t know of a planned build.
Please note that I simply forked the project so I could modify the sample application to expose the password import hook. I did not add this functionality into the project, that already exists.

I just thought it might be easier to see how the hook functionality worked if it was added to the sample application.