Skip to content

Create a password import inline hook
Webhook

Request

Creates a password import inline hook request, one type of inline hook supported by Okta. This is an automated request from Okta to your third-party service endpoint. This reference provides sample JSON objects that are contained in the outbound request from Okta to your external service, and sample JSON objects that you can include in your response. The objects that you return in the JSON payload of your response to this Okta request are an array of one or more objects, which specify the Okta commands to execute.

Note: The size of your response payload must be less than 256 KB.

The password import inline hook allows you to migrate users from another data store where you want the users to retain their current passwords. Use this hook with the Create user with password import inline hook flow that's described in the Users API.

The password import inline hook is triggered when the user tries to sign in to Okta for the first time. Okta sends your external service the password that the user supplied. Your external service then needs to send a response to Okta indicating whether the password supplied by the end user is valid.

If your service returns a response that indicates that the password is valid, Okta sets the password for the user. The password import inline hook won't need to call your service again. However, if the Okta service is in read-only mode, it might not be possible to set the password. Okta then needs to call your service again the next time the user attempts to sign in. See Password inline hook and Okta read-only mode and Removing password from existing user store.

Notes:

  • Password policies don't apply to the password import inline hook. That is, if your external service validates the password, the password is imported even if it doesn't meet the Okta password policy requirements.
  • You can create only one password import inline hook per org.

See also:

Enable a password import inline hook

To enable a password import inline hook, you first need to register your external service endpoint with Okta and configure it as an inline hook of type com.okta.user.credential.password.import. You can enable the hook using the Admin Console, see Add an inline hook or through the Inline Hooks Management API. When creating a user with the Users API, you need to use the Create User with password import inline hook use case. This involves specifying a credentials.password.hook property in the request body.

When the user that you have added attempts to sign in to Okta for the first time, the hook is triggered and Okta calls your external service. The call sends the credentials that the end user provided. Your service can check the credentials and respond with a command to indicate whether the credentials are valid or not.

Password inline hook and Okta read-only mode

If your external service responds to Okta indicating that the credentials are valid, Okta saves the password and can authenticate the user independently from then on. However, if your Okta org is in a special read-only mode at the time the user signs in, then saving the password might not be possible. The next time the end user attempts to sign in, the password import inline hook needs to be called again.

Password removal from an existing user store

Because of the possibility of your org being in a special service mode, you shouldn't attempt to permanently delete user passwords from your existing user store until you can verify the success of the password import . An Okta System Log Event, user.import.password, is available for this purpose. An event of this type is created every time a password import inline hook is fired, with its Event.Outcome property providing a status of FAILURE or SUCCESS for the password import operation. If the status is SUCCESS, Okta has successfully saved the end user's password, and it's safe to delete it from your previous user store.

You can configure an Event hook to send this event type to you for use when triggering automated cleanup of end-user passwords after successful migration.

Bodyapplication/jsonrequired
cloudEventVersionstring

The inline hook cloud version

Example:0.1
contentTypestring

The inline hook request header content

Example:"application/JSON"
eventIdstring

The individual inline hook request ID

Example:"3o9jBzq1SmOGmmsDsqyyeQ"
eventTimestring

The time the inline hook request was sent

Example:"2020-01-17T21:23:56.000Z"
eventTypeVersionstring

The inline hook version

Example:1
dataobject(PasswordImportRequestData)
eventTypestring

The type of inline hook. The password import inline hook type is com.okta.user.credential.password.import.

sourcestring

The ID and URL of the password import inline hook

Payload
{ "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/cbl2ad6phv9fsPLcF0g7", "data": { "context": { … }, "action": { … } } }

Responses

Successful response

Bodyapplication/json
commandsArray of objects

The commands object specifies whether Okta accepts the end user's sign-in credentials as valid or not. For the password import inline hook, you typically only return one commands object with one array element in it.

Response
{ "commands": [ { … } ] }