# Password change ticket URL results(ed) in different UI although New UL is activated – redirect doesn't work reliably

**URL:** <https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802>\
**Category:** Get Help\
**Tags:** ticket, change-password, auth0\
**Created:** [March 30, 2022, 11:54am UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802 "2022-03-30T11:54:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter-valuecase](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter-valuecase/32/36251_2.png) [@peter-valuecase](https://community.auth0.com/u/peter-valuecase)\
**Post date:** [March 30, 2022, 11:54am UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/1 "2022-03-30T11:54:44Z")

</div>

Hey, first time on the Forum. I’ll give my best 🙂

What we want to achieve is, that

- we create an account for a user using the management API
  - `verify_email = false`
  - `email_verified = false`

- we issue a password change ticket
  - `user_id = {USER_ID}`
  - `client_id = {CLIENT_ID}` (in order to enable redirect)
  - `mark_email_as_verified = true`

- we send user the ticket URL via our own mail service
- the user
  - opens the password change ticket URL,
  - sets a new password
  - and will be redirected to the applications login URL (or to **some** URL)

According to the management API docs, the redirect should work, if we set the `client_id`:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/e/0/e0075b713cf024fbe3b107d74853e40ac60c27b2.jpeg)

**BUT, it does not work … respectively until yesterday evening DID NOT work … now it somehow works.**

# Our setup:

- Node.js
- Management API calls via npm package `auth0`
- New Universal Login experience is activated

I tested three scenarios:

* * *

## 1st test:

```auto
const passwordChangeTicketResponse = await auth0.createPasswordChangeTicket({
    mark_email_as_verified: true,
    user_id: createdUser.user_id,
    client_id: auth0ClientId
})

```

**Today:**  
Ticket URL: `https://SUBDOMAIN.auth0.com/lo/reset?ticket=A76e2...`  
Setting password works: `YES`  
User is redirected after setting password: `NO`

**Until yesterday:**  
Ticket URL was something like this: `https://SUBDOMAIN.auth0.com/u/reset-password?ticket=asd87...`  
And the UI was different compared to today??

* * *

## 2nd test:

```auto
const passwordChangeTicketResponse = await auth0.createPasswordChangeTicket({
    mark_email_as_verified: true,
    user_id: createdUser.user_id,
    result_url: "https://google.de" // respectively our URLs
})

```

**Today:**  
Ticket URL: `https://SUBDOMAIN.auth0.com/lo/reset?ticket=asd987...`  
Setting password works: `YES`  
User is redirected after setting password: `YES`

**Until yesterday:**  
Ticket URL was something like this: `https://SUBDOMAIN.auth0.com/u/reset-password?ticket=765asd7...`  
And the UI was different too!

**What wonders me here** :

According to the API docs the user should be redirect to the Classic Universal Login … but it looks exactly the same like in the 1st approach:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/a/5a1fa1f4579ea994f7c677bece1744c0fc03f227.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/6/8614c635991008715f1fb92303eb28ebade9396b.jpeg)

* * *

## 3rd test ( **The only one which worked until _yesterday_**!)

```auto
const passwordChangeTicketResponse = await auth0.createPasswordChangeTicket({
    mark_email_as_verified: true,
    user_id: createdUser.user_id,
    includeEmailInRedirect: true,
    result_url: "https://google.de"
})

```

Here `includeEmailInRedirect: true` was somehow the trigger to now generate URLs with a pathname like `/lo/reset?...` instead of `/u/reset-password?...`

Here everything worked yesterday (but I mean, the flag `includeEmailInRedirect` should not be the one enabling redirects…).

* * *

# So following questions:

- Have there been any changes to the Management API which caused the different behavour between yesterday and today?
- How was it possible to generate (I assume) Classic Universal Login password change tickets by passing `client_id`?
- **What’s the correct way to redirect a user after resetting the password?**

I hope I could clearly demonstrate my problems. Hopefully someone can help me out to better understand what’s going on 🙂

Peter

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 31, 2022, 3:38pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/3 "2022-03-31T15:38:02Z")

</div>

Hi @peter-valuecase,

Welcome to the Auth0 Community!

Great first topic btw! Very thorough 😄

Looking at the screenshot you shared, it looks like **you are using Classic Universal Login.** You can choose classic or new, but you cannot use both, and how your users are redirected after password reset will depend on which one you chose.

Classic login will redirect to the link you provide.

New login will redirect to the default login route of the app or tenant.

> [@peter-valuecase](#):
>
> What we want to achieve is, that  
> …
> 
> - we send user the ticket URL via our own mail service
> - the user
> - opens the password change ticket URL,
> - sets a new password
> - and will be redirected to the applications login URL (or to **some** URL)

You **must use New Universal Login** to have this flow.

To confirm you have New Universal Login configured, in the dashboard navigate to _Branding_ and confirm that New Universal Login is selected.

Here is an example of what you should see:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/d/4d07eae5a3238889680493d95f349e89a786e6d7.png)

**Important:** If you seeing the following warning, you are using Classic UL:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/f/bf3a2c443771486c4f0c634ecce825a925f3a07e.png)

---

<div class="post-metadata">

**Author:** ![peter-valuecase](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter-valuecase/32/36251_2.png) [@peter-valuecase](https://community.auth0.com/u/peter-valuecase)\
**Post date:** [March 31, 2022, 3:57pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/4 "2022-03-31T15:57:56Z")

</div>

Thanks for your reply!

The tip with the warning was helpful: Now the API returns a New Universal Login password change ticket URL.

**But the user is never redirected**. The screen stays exactly like that:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/c/fcad81eaf1a79c5b3b12920527ab18b8d1f9924d.jpeg)

What did I do?

```auto
const passwordChangeTicketResponse = await auth0.createPasswordChangeTicket({
    mark_email_as_verified: true,
    user_id: createdUser.user_id,
    client_id: auth0ClientId
})

```

According to the API docs, passing `client_id` AND having the application’s login URI set should trigger a redirect, right?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/f/5f1c3c140f8843c6c0b01db0173cbd3e9c6285ce.jpeg)

Login URI is set:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/d/3d4792a1f74b743e50cdaea6c073dd4aedb578f2.jpeg)

What else could be missing or or improperly configured?

Thanks for you help!

Peter

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 31, 2022, 6:07pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/5 "2022-03-31T18:07:03Z")

</div>

Looks like we are narrowing it down.

Which client ID are you sending? Make sure you are sending the client ID of the app that has the associated Login URI, and not the client ID of the backend app (if these are separate apps).

---

<div class="post-metadata">

**Author:** ![peter-valuecase](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter-valuecase/32/36251_2.png) [@peter-valuecase](https://community.auth0.com/u/peter-valuecase)\
**Post date:** [April 1, 2022, 5:33am UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/6 "2022-04-01T05:33:39Z")

</div>

I think I figured it out! So as always, the problem was sitting in front of the PC 😇

In order to use the Management API we added the corresponding M2M-Applications to the granted applications of the Management API in the API section - along with the needed rights in order to perform the password change ticket request.

**But this M2M-Application did not have an Application Login URI – after setting it, I finally saw the “Back to …”-Button after setting the password:**

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/e/1eb4cdf4c788e382e3965ddf1855eccfb4c453dc.jpeg)

This works for us like expected!

Thanks for guiding me to the right direction. I really appreciate the help/support here 🙂!

Peter

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 1, 2022, 12:25pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/7 "2022-04-01T12:25:46Z")

</div>

Glad you figured it out.

A word of advice on this; you should be using the client ID of the application that you would like your use to log into after the successful password reset.

It looks like you had a SPA configured, and I would suspect that is the client ID you should be sending with the password ticket request.

---

<div class="post-metadata">

**Author:** ![peter-valuecase](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter-valuecase/32/36251_2.png) [@peter-valuecase](https://community.auth0.com/u/peter-valuecase)\
**Post date:** [April 1, 2022, 2:34pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/8 "2022-04-01T14:34:53Z")

</div>

Due to our application being a `SPA` and with `Token Endpoint Auth Method` set to `None` I am not able to enable the `Client Credentials` grant type, which would allow to get a token using client id and secret for the Management API.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/1/c19ac3b4287b0db9c7f9996cdb6cd31341b5c26e.jpeg)

Is there a better way to obtain a token for the backend service? Or can you recommend an other setup?

Thanks in advance!

Peter

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 1, 2022, 2:49pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/9 "2022-04-01T14:49:36Z")

</div>

You will still need two apps, an M2M backend app, and a SPA client app.

You should request the token with the credentials for you M2M app, and will request the ticket with the client ID for the SPA.

For example:

```auto
const ManagementClient = require('auth0').ManagementClient;
const auth0 = new ManagementClient({
  domain: '{YOUR_DOMAIN}',
  clientId: '{YOUR_M2M_CLIENT_ID}',
  clientSecret: '{YOUR_M2M_CLIENT_SECRET}',
  scope: '{SCOPES}',
})

const passwordChangeTicketResponse = await auth0.createPasswordChangeTicket({
    mark_email_as_verified: true,
    user_id: createdUser.user_id,
    client_id: '{YOUR_SPA_CLIENT_ID}'
})

```

The reason you are using your SPA client id in the ticket request is that you want to redirect your user back to your SPA after a password reset (if I understand your desired flow correctly). The default login route from that client is then attached to the ticket.

Hope that helps to clarify things!

---

<div class="post-metadata">

**Author:** ![peter-valuecase](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter-valuecase/32/36251_2.png) [@peter-valuecase](https://community.auth0.com/u/peter-valuecase)\
**Post date:** [April 1, 2022, 3:27pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/10 "2022-04-01T15:27:22Z")

</div>

Oh I got it. Use the M2M-Application to obtain the token, but pass the actual Application’s client\_id in order to use the correct login URI.

Thanks, got it 🙂

Peter

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 1, 2022, 3:30pm UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/11 "2022-04-01T15:30:06Z")

</div>

You got it! Let me know if you have other questions.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 22, 2022, 12:04am UTC](https://community.auth0.com/t/password-change-ticket-url-results-ed-in-different-ui-although-new-ul-is-activated-redirect-doesnt-work-reliably/80802/12 "2022-04-22T00:04:17Z")

</div>


