K
Kinde6mo ago
_danicas_

Create a user with username and password authentication using the API

Hello I'm trying to create a user using the following documentation: https://kinde.com/api/docs/#create-user The only options I have there is to create a user with email, phone or username. What do I need to do to be able to create a user with username and password? My goal is to have a form in my FE, make valiadions in my BE and have my BE make a request to create a user in Kinde after the validations passed. Once your endpoint sends a response I will store the ID in my user table with the other information that is relevant to me. The user in Kinde will be like a principal. Can you help me?
3 Replies
onderay
onderay6mo ago
Thanks for checking out Kinde. Sound like you would like to make use of our custom sign in and sign up pages - https://docs.kinde.com/authenticate/custom-configurations/custom-authentication-pages/#_top With our current functionality if you want a user to set their own password, you will still need to send them to a Kinde hosted page to for that part of the sign up process. But if you want to create a user with a username and a password in Kinde, you'll need to follow a two-step process. First, create the user with a username, and then set a password separately. And then you will need to communicate this password to the user. Create User with Username To create a user with a username, you can use the Create User API endpoint. Here's how you can structure your request:
{
"profile": {
"given_name": "string",
"family_name": "string"
},
"identities": [
{
"type": "email",
"details": {
"email": "string",
"phone": "string",
"username": "string"
}
}
]
}
{
"profile": {
"given_name": "string",
"family_name": "string"
},
"identities": [
{
"type": "email",
"details": {
"email": "string",
"phone": "string",
"username": "string"
}
}
]
}
In this request, you'll need to provide the username in the identities array. Password Authentication https://kinde.com/api/docs/#set-user-password For your use case, you might consider using a temporary password generator.
Kinde docs
Custom sign-up and sign-in pages
Our developer tools provide everything you need to get started with Kinde.
_danicas_
_danicas_OP5mo ago
Hello André! Thank you for the quick response it was very helpful, Am I correct to assume you meant to show "type": "username" in the request body example?
Daniel_Kinde
Daniel_Kinde5mo ago
Hi @danicas , Yes you're correct.
Want results from more Discord servers?
Add your server