About Kinde authentication
Auth and access
When you use Kinde to authenticate users via an enterprise connection such as SAML, you also need a way for users to be identified in Kinde so they match the identities stored in your Identity Provider (IdP).
In general, an email address can be used to map users across systems, but because enterprise connection users can have aliases and proxy addresses, there are better ways to keep identities in sync.
Here’s how we recommend mapping user profiles and keeping them synced for enterprise connections.
When users are imported or added to Kinde, a unique user ID is generated. For example, kp:1876b10742894a0c9M8e725048e7a323
. We recommend you map each user’s Kinde ID back to your product, and use this as the primary auth identifier. This will keep profiles in sync and support a seamless authentication experience.
You can access user IDs via the API by calling GET /api/v1/users
. This will return a response with a users array with the following data:
Where:
id
is the kinde IDprovided_id
is the ID you may have provided when you imported your users. This ID can also be useful to match imported users to your local database records.As part of your business authentication setup, we recommend switching on user profile sync to keep enterprise and social profiles up to date across providers.
Webhooks are a method of being notified when an event occurs in Kinde, e.g. a user is created. You can register your own endpoint URLs in Kinde, and each time the event occurs, data for that event will be sent to your endpoint.
Here’s some examples of webhook events that can be used to keep your users in sync:
user.created
- when a user is created in Kinde either via the admin UI or registeringuser.updated
- when a user is added to an organization, their roles or permissions change, or when their assigned properties changeuser.deleted
- when a user is deleted via the UI or via the APIHere’s an example json schema for user.updated that could be used to sync your data:
You can see a full list of events in the Kinde UI under Settings > Webhooks, or by calling the Kinde management API which also provides the JSON schema GET /api/v1/event_types
.
Read more about webhooks.