Skip to content

Commit

Permalink
docs: link user register to metadata for custom fields (#8117)
Browse files Browse the repository at this point in the history
# Which Problems Are Solved

an admin wants to know how to register a new user with some custom
fields

# How the Problems Are Solved

We already had examples about user metadata and onboard new users, but
the link between those and how to use it was missing.

# Additional Context

Replace this example with links to related issues, discussions, discord
threads, or other sources with more context.
Use the Closing #issue syntax for issues that are resolved with this PR.
- Closes #7951

---------

Co-authored-by: Livio Spring <[email protected]>
  • Loading branch information
hifabienne and livio-a committed Jun 14, 2024
1 parent a000449 commit cc00ee8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/docs/guides/integrate/login-ui/username-password.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ sidebar_label: Username and Password
First, we create a new user with a username and password. In the example below we add a user with profile data, a verified email address, and a password.
[Create User Documentation](/apis/resources/user_service/user-service-add-human-user)

### Custom Fields

If you have custom fields you like to add to your users that are not provided by ZITADEL, you can add them to the metadata.
Metadata are key value pairs you can use for additional user data.
These fields can also be included in the token of the user, so you have access to it all the time.
Read more about the metadata [here](/docs/guides/manage/customize/user-metadata)

### Request

```bash
Expand Down
7 changes: 5 additions & 2 deletions docs/docs/guides/integrate/onboarding/end-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Please follow the configuration guides for the needed providers: [Let Users Logi

import OrgLoginDescription from "./_org_login_description.mdx";

<OrgLoginDescription name="OrgLodinDescription" />
<OrgLoginDescription name="OrgLoginDescription" />

### Build your own registration form

Expand All @@ -117,8 +117,11 @@ We do have a guide series on how to build your own login ui, which also includes

You can find all the guides here: [Build your own login UI](/docs/guides/integrate/login-ui)

The create user request also allows you to add metadata (key, value) to the user.
#### Custom fields

The [create user request](/docs/apis/resources/user_service/user-service-add-human-user) also allows you to add [metadata](/docs/guides/manage/customize/user-metadata) (key, value) to the user.
This gives you the possibility to collect additional data from your users during the registration process and store it directly to the user in ZITADEL.
Those metadata can also directly be included in the [token](/docs/guides/manage/customize/user-metadata#use-tokens-to-get-user-metadata) of the user.
We recommend storing business relevant data in the database of your application, and only authentication and authorization relevant data in ZITADEL to follow the separation of concern pattern.

#### Registration with Organization External Identity Provider
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/guides/manage/customize/user-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ An example response for your search looks like this:
}
```

## Register user with custom metadata

When you build your own registration UI you have the possibility to have custom fields and add them to the metadata of your user.
Learn everything about how to build your own registration UI [here](/docs/guides/integrate/onboarding/end-users#build-your-own-registration-form).

## Manage user metadata through the management API

The previous methods allowed you to retrieve metadata only for the `sub` in the access token.
Expand Down

0 comments on commit cc00ee8

Please sign in to comment.