<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
0D51Y00008MtlorSABOkta Classic EngineLifecycle ManagementAnswered2024-04-15T09:30:27.000Z2020-04-24T09:03:31.000Z2020-04-29T13:20:21.000Z

PatriciaD.95901 (Customer) asked a question.

Use activationLink got by API in a custom email

Hello,

I have a problem.

I use the API to get an activationLink returned by the function "activate" with sendEmail = false. It returns a link to me, that I want to use in a self-custom email.

The problem is that when clicking on the link in my email, which is sent to the users, the link is always expired.

I don't understand why ? Is it possible to use the activationLink in a non-Okta email ? Or is there another way to to do it ?

Thanks


  • Hi Patricia,

     

    Are you creating a User without Credentials or with Credentials ? Have you tried to click on link obtained other than email, probably using Postman to activate user? is it working ? how long it take to receive activation link via custom email and clicking on link? make sure the timeout as below.

     

    By default, the activation email is valid for one day. This can be edited by performing the followings steps:

    • in the Okta Admin Console, navigate to Security > General
    • in the Organization field, click Edit
    • choose the desired time in the Activation emails are valid for drop down box. The choices are:
      • 8 hours
      • 1 day
      • 7 days
      • 30 days
      • 90 days
      • 180 days

     

    Expand Post
  • 2gfue (2gfue)

    Have you check ${org.activationTokenExpirationHours} value what is going ?

    Also check - default value for "Activation emails are valid for"

     

    By default, the activation email is valid for one day. This can be edited by performing the followings steps:

    • in the Okta Admin Console, navigate to Security > General
    • in the Organization field, click Edit
    • choose the desired time in the Activation emails are valid for drop down box. The choices are:
      • 8 hours
      • 1 day
      • 7 days
      • 30 days
      • 90 days
      • 180 days

     

    Expand Post
  • PatriciaD.95901 (Customer)

    Hello, thanks for your answers.

    A little more informations about your remarks :

    • in my settings, the emails are valid for 30 days
    • I call the API to create a user without credentials and without sending mail. Then The user is created with status STAGED. It's OK.
    • when my application generates our welcome applicative email, I want to add in its content the activationLink provided by the Okta API.
    • I've tested the actionLink provided by the API by pasting it directly in a navigator : it works fine. When I click the link (not the same, that is already used) which is embedded in our email, it fails with token expiration error.
    • I've tested in Postman and it works fine too
    Expand Post
  • bc221 (bc221)

    by looking at your comment it look like you done it right way. I think you should create a case with Okta for further troubleshooting.

  • PatriciaD.95901 (Customer)

    Thanks to all for your help. It appeared that the piece of code, where is embedded the code to manage the Okta activation link, was called twice. I was getting the result of the first call but the other call was generating another token. So my token was expired. The problem is now solved... hard trick to find out this weird behaviour ! Thanks !

This question is closed.
Loading
Use activationLink got by API in a custom email