Custom Set Password Flow for Activated Account without Password

,

Hi, I have implemented the following flow for user activation.

  1. The user account is created using Management SDK - Create Activated User without Credentials.
  2. User received an email with activation link (e.g https:/ /dev-XXXXXXX.okta.com/tokens/CZwHDVBifxts2RQuxqw9/verify)
  3. When user click on the link, it will redirect to okta hosted page for setup password
  4. User setup their own password
  5. Setup any okta MFA or skip
  6. Redirect to Okta Dashboad

Is it doable by Auth JS SDK to replace step 4-5 instead of using okta hosted page?

If yes, kindly can link me up with any documentation on what sdk to inititalise the process flow.
e.g authClient.idx.register (…) or authClient.idx.proceed({ email: email…})… etc.

Thank you

I found this which seem to be handling user activation token within the code in okta-auth-js/samples/generated/express-embedded-auth-with-sdk at master · okta/okta-auth-js · GitHub under web-server/routers/register.js

// entry route
router.get('/register', async (req, res, next) => {
  req.setFlowStates({
    entry: '/register'
  });
  const authClient = getAuthClient(req);

  const { query } = req;
  const activationToken = query['activationToken'] || query['token'];
  
  const transaction = await authClient.idx.register({ activationToken });
  if (transaction.error) {
    next(transaction.error);
    return;
  }

  const {
    nextStep
  } = transaction;

  const { inputs } = nextStep;

  if (activationToken) {
    handleTransaction({ req, res, next, authClient, transaction });
    return; 
  }

  renderTemplate(req, res, 'enroll-profile', {
    action: '/register',
    inputs
  });
});

I am getting this error when I trying to access it using http://localhost:8080/register?token=XXXXX
Following is the line of code which is getting the error:

  const transaction = await authClient.idx.register({ activationToken });

I can’t find any related config for activation token in the okta console.

AuthSdkError: activationToken is not supported based on your current org configuration.
    at register (C:\vue\okta_sample\okta-auth-js-master\okta-auth-js-master\samples\generated\express-embedded-auth-with-sdk\node_modules\@okta\okta-auth-js\cjs\idx\register.js:44:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\vue\okta_sample\okta-auth-js-master\okta-auth-js-master\samples\generated\express-embedded-auth-with-sdk\web-server\routes\register.js:34:23 {

  errorCode: 'INTERNAL',
  errorSummary: 'activationToken is not supported based on your current org configuration.',
  errorLink: 'INTERNAL',
  errorId: 'INTERNAL',
  errorCauses: []

Please help.