<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
0D50Z00008ZjCYUSA3Okta Classic EngineSingle Sign-OnAnswered2024-04-15T12:57:56.000Z2018-11-19T18:14:19.000Z2020-05-06T20:23:54.000Z
Password Reset - "Reset Password" Button destination

I'm testing the reset password process on our account, and I'm experiencing the following:

 

1. Click "Need help signing in?"

2. Click "Forgot password?"

3. Enter email address

4. Click "Reset via Email"

5. In the "Account password reset" email click the "Reset Password" button

6. Fill in the new password fields

7. Click the "Reset Password" button

 

** I am then redirected to a page that causes a 403 error which is then displayed in the okta error page.

 

My question is: Can I configure where the "Reset Password" button in step 7 sends the browser? I would like it to go to our main app home page instead of where it is attempting and failing to redirect now.


RichR.34741 likes this.
  • RichR.34741 (Customer)

    After going back and forth with support for a few days we determined that there is built-in way to customize the destination of the Reset Password button. Instead I had to put some custom javascript in the Okta log in page (from the Okta dashboard: Settings | Customization | Custom Sign In - then edit the HTML). I changed the success function provided in the original in-line Javascript on line 29 from just passing in the OktaUtil.completeLogin function to a new function that receives response as a parameter, calls OktaUtil.completeLogin passing response, and then, if the widget is currently in Reset Password mode and response.status is 'SUCCESS', it sets the window location href to the URL of our app that we need to redirect to.

     

    Note that I tried to post my code here, but the page wouldn't allow it. It said I had some illegal html in my post.

     

    Upside:

    The okta sign in page now redirects to our app after resetting the password.

     

    Downside:

    The sign in page does not have time to start a user session after resetting the password. If I used a timeout or something the page would redirect to the okta dashboard again, so I couldn't wait for the session to start. Therefore, after redirecting to our app the user is sent to the sign in page again where they have to enter their username and - now for the third time - their password.

     

    Another downside is that I could not find a documented way to determine what mode the sign in widget is in. There were several ways to tell based on the DOM, but in the end I just went with using the current path in window.location.href. None of these methods are documented though, so in theory any of them could break at any time.

     

    Hopefully this solution helps someone. If you need this feature too, go to the feature request page and upvote:

    https://support.okta.com/help/s/idea/0870Z000000JxZ5QAK/detail

    Expand Post
    Selected as Best
  • RichR.34741 (Customer)

    Well, that was about as unhelpful an answer as one can possibly imagine. It makes me wonder if Adina even read the question.

  • RichR.34741 (Customer)

    After going back and forth with support for a few days we determined that there is built-in way to customize the destination of the Reset Password button. Instead I had to put some custom javascript in the Okta log in page (from the Okta dashboard: Settings | Customization | Custom Sign In - then edit the HTML). I changed the success function provided in the original in-line Javascript on line 29 from just passing in the OktaUtil.completeLogin function to a new function that receives response as a parameter, calls OktaUtil.completeLogin passing response, and then, if the widget is currently in Reset Password mode and response.status is 'SUCCESS', it sets the window location href to the URL of our app that we need to redirect to.

     

    Note that I tried to post my code here, but the page wouldn't allow it. It said I had some illegal html in my post.

     

    Upside:

    The okta sign in page now redirects to our app after resetting the password.

     

    Downside:

    The sign in page does not have time to start a user session after resetting the password. If I used a timeout or something the page would redirect to the okta dashboard again, so I couldn't wait for the session to start. Therefore, after redirecting to our app the user is sent to the sign in page again where they have to enter their username and - now for the third time - their password.

     

    Another downside is that I could not find a documented way to determine what mode the sign in widget is in. There were several ways to tell based on the DOM, but in the end I just went with using the current path in window.location.href. None of these methods are documented though, so in theory any of them could break at any time.

     

    Hopefully this solution helps someone. If you need this feature too, go to the feature request page and upvote:

    https://support.okta.com/help/s/idea/0870Z000000JxZ5QAK/detail

    Expand Post
    Selected as Best
  • RichR.34741 (Customer)

    Hmm, can't edit my posts - nice. Please excuse any typos above, especially the first sentence which should read "... there is no built-in way to customize ..."

  • 23xnq (23xnq)

    Hi Rich, any chance you could send me your code snippet you mentioned above as I have the same scenario for our application. I can send you my email or other contact info for whatever works.

     

    Cheers,

    Simon

    Expand Post
  • RichR.34741 (Customer)

    If I remember correctly we found that the okta account type made the difference here. The code that I refer to above was just not a satisfactory solution. It turned out that our okta account for our production environment had the ability to set a default application other than the okta dashboard, but as I was working in our lab account which was a less capable account type, I could not see that. In the end we took out and threw away the code that I refered to above. Our lab account still redirects to the okta dashboard, but in our production account I was able to configure it to redirect to our app. I don't know what the difference between the account types is because I was not the person at our company that set the accounts up originally.

    Expand Post
  • 23xnq (23xnq)

    Thanks for getting back. We are in the same situation. I'm currently working through the code mechanics to convert a current application to Okta authentication utilizing an Okta Dev tenant. We have a production tenant but not yet set up so I'll try that to confirm this process works ok. Thanks for your help, much appreciated.

  • SarikaS.26257 (Customer)

    Simon -- were you able to confirm that the page/url viewed by user after successfully resetting the password can be customized in the prod instance? Thanks

  • 23xnq (23xnq)

    The solution we are going with is single independent generic web page for all applications that simply says "Password reset successful". The feature to drive users back to specific applications does not exist. It's in the pipeline of requests but no idea when it will be done.

  • SarikaS.26257 (Customer)

    Simon -- appreciate your quick response. I'm assuming that the password reset in your use case is being done in a non-Okta domain that you control and the password is being written back to Okta via API?

     

    Or did you use the inline HTML editor to write custom code as described by OP

    Expand Post
This question is closed.
Loading
Password Reset - "Reset Password" Button destination