How to Create a password change ticket in secondary identity?

use Account Link at primary identity is google, secondary identity is auth0.
want get password change ticket at secondary identity.
use this api: Auth0 Management API v2
try connection_id and email send but error messaged “The user does not exist”.
how to create a password change ticket?

Hi @pop ,

Welcome to the Auth0 Community!

I understand that you want to create a password change ticket for the secondary id which is an auth0 id.

Could you please try below scripts?

{
  "user_id":"google-oauth2|103200078395965841111",  -> primary user id
  "identity": {
    "user_id": "6322635427a945dafe4edddd",   -> secondary user id.
    "provider": "auth0"
  }
}

The second user id can be found under the user settings.

Hope this helps!

@lihua.zhang
Thank you for reply.
I tried identity params.
But response is

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Payload validation error: 'Additional properties not allowed: identity'.",
  "errorCode": "invalid_body"
}

The API I tried is /api/v2/tickets/password-change, is that correct?

Hi @pop ,

Sorry, I tried with an incorrect endpoint earlier. Could you please try the below scripts?

{
  "connection_id":"con_FZ5hzCqBaWtoMDKK",  -> id of your Username-Password-Authentication connection
  "email":"aaa.bbb@xxx.com". -> email of the linked account.
}

The script is successful and I could update my auth0 (secondary) account password successfully.

Hope it works for you as well!

@lihua.zhang
thanks.
I tried connection_id and email send but error messaged “The user does not exist”.

{
  "statusCode": 404,
  "error": "Not Found",
  "message": "The user does not exist",
  "errorCode": "inexistent_user"
}

I try Username-Password-Authentication > Try Connection login is “It Works!”.
Do i need to configure anything?

my row json
{
    "created_at": "2022-09-05T04:33:45.909Z",
    "email": "xxxx@gmail.com",
    "email_verified": true,
    "identities": [
        {
            "provider": "google-oauth2",
            "user_id": "xxxx",
            "connection": "google-oauth2",
            "isSocial": true
        },
        {
            "profileData": {
                "email": "xxx@xxx.xx", <- use email
                "email_verified": true
            },
            "connection": "Username-Password-Authentication",
            "provider": "auth0",
            "user_id": "yyyy",
            "isSocial": false
        }
...

The scripts I provided here are the body scripts that work fine on my end.

I checked the tenant associated with your email and noticed there are no users under the tenant. Not sure if that is the correct one. Could you please DM me your tenant name, connection_id, and user email? Thanks!

1 Like

This topic was automatically closed after 11 days. New replies are no longer allowed.