keycloak/keycloak-nodejs-admin-client

Refactor RequiredActionAlias

Closed this issue · 3 comments

We have the enum RequiredActionAlias defined as follow

export declare enum RequiredActionAlias {
    VERIFY_EMAIL = "VERIFY_EMAIL",
    UPDATE_PROFILE = "UPDATE_PROFILE",
    CONFIGURE_TOTP = "CONFIGURE_TOTP",
    UPDATE_PASSWORD = "UPDATE_PASSWORD",
    terms_and_conditions = "terms_and_conditions"
}

Since on Keycloack we have the ability to create our own custom required actions using SPI I feel this enum should be more generic otherwise we are gonna have typing issues.

What about something like this?

export declare enum StandardRequiredActionAlias {
  VERIFY_EMAIL = "VERIFY_EMAIL",
  UPDATE_PROFILE = "UPDATE_PROFILE",
  CONFIGURE_TOTP = "CONFIGURE_TOTP",
  UPDATE_PASSWORD = "UPDATE_PASSWORD",
  terms_and_conditions = "terms_and_conditions"
}

export declare type RequiredActionAlias = StandardRequiredActionAlias | string

This will allow us to do

client.users.executeActionsEmail({
   id: "123"
   actions: ["INVITE_USER", StandardRequiredActionAlias.CONFIGURE_TOTP]
 })
}

I have exactly this use case. Is there any way to send a custom requiredAction without building a post request on my own?

We need this too. Is there any plan to make the RequiredActionAlias extendable?

thanks

As a workaround use "YOUR_ACTION" as RequiredActionAlias