K
Kinde5d ago
Tempo

Assigning identities when creating a user.

Using https://github.com/kinde-oss/management-api-js I am unable to add identities of type 'email' or 'phone'. I am able to create the user in org without the identities array but when adding the array the only type that seems to be working is 'username'. I initially tried everything formatted exactly as is in the doc 'JavaScript fetch' code snippet. https://docs.kinde.com/kinde-apis/management/?subdomain=&token=#tag/users/post/api/v1/user When trying everything individually only type: 'username' does not come back with 'Bad Request'. When trying all the details together only type: 'username' works and only the username is saved.
GitHub
GitHub - kinde-oss/management-api-js: javascript package for intera...
javascript package for interacting with the Kinde Management API - kinde-oss/management-api-js
Kinde docs
Kinde Management API
The management API is for managing your Kinde account. Most things that can be done via the Kinde admin UI can be done with this API
1 Reply
Tempo
TempoOP4d ago
Update: This works in the 'Test Request' environment. Does not work with the SDK when using requstBody.
await kindeSDK.Users.createUser({
requestBody: {
profile: {
given_name: submission.value.newUserFirstName,
family_name: submission.value.newUserLastName
},
organization_code: submission.value.kindeOrgId,
identities: [{
type: "username",
details: {
username: submission.value.newUserUsername
}
}, {
type: "email",
details: {
email: submission.value.newUserEmail,
}
}, {
type: "phone",
details: {
phone: submission.value.newUserPhoneNumber,
phone_country_id: "nz",
}
}]
}
})
await kindeSDK.Users.createUser({
requestBody: {
profile: {
given_name: submission.value.newUserFirstName,
family_name: submission.value.newUserLastName
},
organization_code: submission.value.kindeOrgId,
identities: [{
type: "username",
details: {
username: submission.value.newUserUsername
}
}, {
type: "email",
details: {
email: submission.value.newUserEmail,
}
}, {
type: "phone",
details: {
phone: submission.value.newUserPhoneNumber,
phone_country_id: "nz",
}
}]
}
})
note: the SDK does not error when passing an empty object.
await kindeSDK.Users.createUser({})
await kindeSDK.Users.createUser({})
This however does not include the user details.
Want results from more Discord servers?
Add your server