Hello,
I am using Java SDK to create password change ticket for a user. In response I get url structured like this:
https://my-tenant.auth0.com/lo/reset?ticket=ticketId
After navigating to that URL I get a blank page that has company branding but no form in it.
If I append #clientId=my-client-id
to it, the resulting url (https://my-tenant.auth0.com/lo/reset?ticket=ticketId#clientId=my-client-id
) works as expected.
Any ideas on what is happening here?
Hi @cerniusnet
While you should not modify the password reset ticket, you CAN add parameters to it. If you add the client ID to it, you should get your branding. A user is not associated with a particular client, so that is not part of the ticket. You’ll have to add that yourself.
John
1 Like
Hi Auth0 team,
this approach does not work for us (still has the “all applications” link). Any updates on adding the clientId to the password reset ticket? Otherwise we can’t send the user to the correct application.
Thanks so much!
Hello,
I’m using this workaround for now.
I’ve created another struct to include clientId along with fields in the ticket struct.
Then used the code from ChangePassword library function using new struct.
This is a simple http call, so it should be fine.
type updatedTicket struct {
*management.Ticket
ClientID string `json:"client_id,omitempty"`
}
ut := &updatedTicket{
Ticket: &management.Ticket{
// Parameters for Classic Mode differ, refer this for details https://auth0.com/docs/api/management/v2/#!/Tickets/post_password_change
ConnectionID: auth0.String(yourConnectionID),
TTLSec: auth0.Int(1234),
Email: auth0.String(email),
MarkEmailAsVerified: auth0.Bool(markAsVerified),
IncludeEmailInRedirect: auth0.Bool(true),
},
ClientID: yourClientID,
}
if err != nil {
your error...
}
var tm *management.TicketManager = client.mgmtAPI.Ticket
// err = tm.ChangePassword(ticket) // replace this with line below
err = tm.Request("POST", tm.URI("tickets", "password-change"), ut)
github ticket: Ticket missing field ClientId for ChangePassword and VerifyEmail · Issue #253 · go-auth0/auth0 · GitHub