Skip to content

Commit 1200315

Browse files
Merge pull request #5604 from bhagyasakalanka/add-resend-code
Add resend code api for add users with email verification
2 parents 23ea431 + 2ba5332 commit 1200315

File tree

7 files changed

+300
-309
lines changed

7 files changed

+300
-309
lines changed

en/asgardeo/docs/guides/users/manage-users.md

Lines changed: 3 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -4,97 +4,9 @@ This guide walks you through the process of managing a user account. An owner or
44

55
## Onboard users
66

7-
There are three ways to onboard a user:
7+
{{product_name}} provides multiple ways to onboard users to your organization. You can add users individually or in bulk using a CSV file. You can also allow users to self-register.
88

9-
- The user can self-register via the My Account portal or the login page of an application if self-registration is enabled in the organization. Learn how to [configure self-registration]({{base_path}}/guides/user-accounts/configure-self-registration/).
10-
- An administrator can onboard users from an on-premise user store by [connecting a remote user store to {{ product_name }}]({{base_path}}/guides/users/user-stores/configure-a-user-store/).
11-
12-
!!! note
13-
If the remote user store access type is read-only, you cannot update the user profiles of users onboarded from this read-only user store.
14-
15-
- An administrator can onboard users from the {{ product_name }} Console.
16-
17-
Let's look at how administrators can onboard users from the {{ product_name }} Console.
18-
19-
### Onboard a single user
20-
21-
1. On the {{ product_name }} Console, go to **User Management** > **Users**.
22-
2. Click **Add User** > **Single User** and provide the following details:
23-
24-
![Add user]({{base_path}}/assets/img/guides/users/add-user-form.png){: width="600" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
25-
26-
- **Email (Username):** A unique email address to identify the user.
27-
- **First Name:** First name of the user. You can add/change this later.
28-
- **Last Name:** Last name of the user. You can add/change this later.
29-
30-
!!! note
31-
You can include additional user details such as phone number, address, and other custom attributes when onboarding a user. This is done via
32-
[attribute configurations]({{base_path}}/guides/users/attributes/manage-attributes/#configure-attributes).
33-
34-
!!! note
35-
36-
- A username is always unique to the organization and you can't change the username once it is created.
37-
- Instead of using the email as the username, you can [configure the username]({{base_path}}/guides/user-accounts/account-login/username-validation/) to be an alphanumeric. Then, you will be asked to enter an alphanumeric username between the configured minimum and maximum lengths.
38-
- The existing users who have already registered with their email address as the username can continue to use it to access applications, instead of having to create a new username.
39-
40-
3. You can either request the user to set the password or set one on the user's behalf.
41-
42-
- **Invite user to set their own password:**
43-
44-
- **Invite via email:** If this option is selected, an email with a confirmation link will be sent to the provided email (username). The user can use the confirmation link to set up a new password.
45-
46-
- **Invite offline:** If this option is selected, the administrator will receive an invite link at the end of user registration. This link can be shared with the user.
47-
48-
- **Set a password for the user:**
49-
If this option is selected, the administrator can set a password for the user. The user can change this password from the [My Account Portal]({{base_path}}/guides/user-self-service/customer-self-service-portal/).
50-
51-
4. Add the user to a group in the next step. You will not see this option if you haven't created any groups in {{ product_name }}.
52-
5. Click **Finish**.
53-
54-
!!! note
55-
If you have selected **Invite offline** or decided to **set a password for the user**, you can copy the corresponding information at the **Summary** page of the wizard and share with the user.
56-
57-
### Onboard multiple users
58-
59-
In addition to adding a single user, you can onboard multiple users at once, either manually or by using a CSV file. This is especially useful for large organizations that seek efficiency.
60-
61-
![Add multiple users]({{base_path}}/assets/img/guides/users/add-multiple-users-form.png)
62-
63-
!!! note
64-
Importing multiple users is only supported for the Asgardeo-provided **DEFAULT** user store.
65-
66-
#### Add multiple users manually
67-
68-
1. On the Asgardeo Console, go to **User Management** > **Users**.
69-
2. Click **Add User** > **Multiple Users**.
70-
3. Switch to the **Manual** tab.
71-
4. Enter the email addresses of the users you want to invite. Press **Enter** after each email to add it to the list.
72-
5. Under Groups, select the group(s) from the dropdown to which users will be added during the import.
73-
6. Click **Add** to send out the invitations.
74-
75-
An email with a confirmation link will be sent to the provided email addresses, allowing the users to set their own passwords.
76-
77-
#### Add multiple users using a CSV file
78-
79-
1. On the Asgardeo Console, go to **User Management** > **Users**.
80-
2. Click **Add User** > **Multiple Users**.
81-
3. Switch to the **File Based** tab.
82-
4. Click **Upload CSV File** or drag and drop a CSV file into the designated area.
83-
5. Ensure your CSV file is formatted correctly, with headers that correspond to user attributes. These attributes must be mapped to local attributes.
84-
85-
- A sample CSV file format would include: `username, givenname, emailaddress, groups`
86-
87-
- For example:
88-
89-
```
90-
username,givenname,emailaddress,groups
91-
user1,john,[email protected],group1|group2
92-
user2,jake,[email protected],group2
93-
user3,jane,[email protected],group1
94-
```
95-
96-
6. Click **Import** to add the users to the system.
97-
7. An email with a confirmation link will be sent to the provided email addresses, allowing the users to set their own passwords.
9+
To learn more about onboarding users, see [Onboard users]({{base_path}}/guides/users/onboard-users/).
9810

9911
## Assign groups
10012
A user can be assigned to different [groups]({{base_path}}/guides/users/manage-groups/) in the organization. Groups can be used to restrict the user's access to resources.
@@ -401,130 +313,4 @@ To filter users by account status:
401313
- **Pending email verification**: Filters users who haven't yet verified their primary email addresses.
402314
- **Pending mobile verification**: Filters users who haven't yet verified their primary mobile numbers.
403315
404-
![Filter users by account status]({{base_path}}/assets/img/guides/users/filter-users-by-account-status.png){: width="600" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
405-
406-
## Add users with email verification
407-
408-
1: Enable email verification
409-
410-
!!! abstract ""
411-
412-
curl -X 'PATCH' \
413-
'https://api.asgardeo.io/t/<org_name>/api/server/v1/identity-governance/VXNlciBPbmJvYXJkaW5n/connectors/dXNlci1lbWFpbC12ZXJpZmljYXRpb24' \
414-
-H 'Authorization: Bearer <access_token>' \
415-
-H 'Content-Type: application/json' \
416-
-d '{
417-
"operation": "UPDATE",
418-
"properties": [
419-
{
420-
"name": "EmailVerification.Enable",
421-
"value": true
422-
}
423-
]
424-
}'
425-
426-
2: Configure email verification method (Optional). Enable this to send OTP via email.
427-
428-
!!! abstract ""
429-
430-
curl -X 'PATCH' \
431-
'https://api.asgardeo.io/t/<org_name>/api/server/v1/identity-governance/VXNlciBPbmJvYXJkaW5n/connectors/dXNlci1lbWFpbC12ZXJpZmljYXRpb24' \
432-
-H 'Authorization: Bearer <access_token>' \
433-
-H 'Content-Type: application/json' \
434-
-d '{
435-
"operation": "UPDATE",
436-
"properties": [
437-
{
438-
"name": "EmailVerification.OTP",
439-
"value": true
440-
}
441-
]
442-
}'
443-
444-
3: Create user with email verification required
445-
446-
!!! abstract ""
447-
448-
=== "Request format"
449-
450-
```curl
451-
curl -X 'POST' \
452-
'https://api.asgardeo.io/t/<org_name>/scim2/Users' \
453-
-H 'Authorization: Bearer <access_token>' \
454-
-H 'Content-Type: application/json' \
455-
-d '{
456-
"userName": "<USERNAME>",
457-
"emails": [
458-
{
459-
"primary": true,
460-
"value": "<EMAIL>"
461-
}
462-
],
463-
"password": "<PASSWORD>",
464-
"urn:scim:wso2:schema": {
465-
"verifyEmail": "true"
466-
}
467-
}'
468-
```
469-
=== "Sample request"
470-
471-
```
472-
curl -X 'POST' \
473-
'https://api.asgardeo.io/t/<org_name>/scim2/Users' \
474-
-H 'Authorization: Bearer <access_token>' \
475-
-H 'Content-Type: application/json' \
476-
-d '{
477-
"userName": "DEFAULT/bob",
478-
"emails": [
479-
{
480-
"primary": true,
481-
"value": "[email protected]"
482-
}
483-
],
484-
"password": "P@ssw0rd",
485-
"urn:scim:wso2:schema": {
486-
"verifyEmail": "true"
487-
}
488-
}'
489-
```
490-
491-
---
492-
**Response**
493-
```
494-
"HTTP/1.1 201 Created"
495-
```
496-
497-
4: Confirm email or validate OTP (One-Time Password)
498-
499-
You can verify the email using the confirmation link, or enter the OTP using the following API.
500-
501-
!!! abstract ""
502-
503-
=== "Request format"
504-
505-
```curl
506-
curl -X 'POST' \
507-
'https://api.asgardeo.io/t/<org_name>/api/identity/user/v1.0/validate-code' \
508-
-H 'Authorization: Bearer <access_token>' \
509-
-H 'Content-Type: application/json' \
510-
-d '{
511-
"code": "<CODE>"
512-
}'
513-
```
514-
=== "Sample request"
515-
516-
```
517-
curl -X 'POST' \
518-
'https://api.asgardeo.io/t/<org_name>/api/identity/user/v1.0/validate-code' \
519-
-H 'Authorization: Bearer <access_token>' \
520-
-H 'Content-Type: application/json' \
521-
-d '{
522-
"code": "c1KLdm"
523-
}'
524-
```
525-
526-
---
527-
**Response**
528-
```
529-
"HTTP/1.1 202 Accepted"
530-
```
316+
![Filter users by account status]({{base_path}}/assets/img/guides/users/filter-users-by-account-status.png){: width="600" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% set base_url = "https://api.asgardeo.io/t/<org_name>" %}
2+
3+
{% include "../../../../includes/guides/users/onboard-users.md" %}

en/asgardeo/mkdocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ plugins:
167167
'guides/applications/register-mcp-client-app.md': 'guides/agentic-ai/mcp/register-mcp-client-app.md'
168168
'guides/authorization/mcp-server-authorization.md': 'guides/agentic-ai/mcp/mcp-server-authorization.md'
169169
'quick-starts/mcp-server.md': 'sdks/asgardeo-mcp-server.md'
170+
170171
exclude_docs: |
171172
/get-started/hello-world.md
172173
@@ -368,7 +369,9 @@ nav:
368369
- User management:
369370
- User management: guides/users/index.md
370371
- Manage administrators: guides/users/manage-administrators.md
371-
- Manage users: guides/users/manage-users.md
372+
- Users:
373+
- Onboard users: guides/users/onboard-users.md
374+
- Manage users: guides/users/manage-users.md
372375
- Manage groups: guides/users/manage-groups.md
373376
- Manage roles: guides/users/manage-roles.md
374377
- Manage active sessions: guides/users/manage-sessions.md

en/identity-server/next/docs/guides/users/manage-users.md

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4,97 +4,9 @@ This guide walks you through how you can manage user accounts as an administrato
44

55
## Onboard users
66

7-
There are three ways to onboard a user:
7+
{{product_name}} provides multiple ways to onboard users to your organization. You can add users individually or in bulk using a CSV file. You can also allow users to self-register.
88

9-
- The user can self-register via the My Account portal or the login page of an application if self-registration is enabled in the organization. Learn how to [configure self-registration]({{base_path}}/guides/account-configurations/user-onboarding/self-registration/).
10-
- An administrator can onboard users from a secondary user store by [configuring a secondary user store in WSO2 Identity Server]({{base_path}}/guides/users/user-stores/configure-secondary-user-stores/).
11-
12-
!!! note
13-
If the secondary user store access type is read-only, you cannot update the user profiles of users onboarded from this read-only user store.
14-
15-
- An administrator can onboard users from the WSO2 Identity Server Console.
16-
17-
Let's look at how administrators can onboard users from the {{ product_name }} Console.
18-
19-
### Onboard single user
20-
21-
1. On the {{ product_name }} Console, go to **User Management** > **Users**.
22-
2. Click **Add User** button and select **Single User** option and provide the user's details.
23-
24-
![Add user]({{base_path}}/assets/img/guides/users/add-user-form.png){: width="600" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
25-
26-
!!! note
27-
- The user's username is always unique to the organization and you can't change the username once it is created.
28-
- Optionally, you can [configure email address as the username]({{base_path}}/guides/users/attributes/enable-email-as-username/). Then, the user must enter the email address when logging in.
29-
30-
!!! tip "Add additional fields to the user onboarding form"
31-
The default form requests for basic information of the user. If you wish to include additional details, such as the user's phone number, address, and other custom attributes, you need to make these attributes available in the **Administrator Console**. Learn how to do so in [attribute configurations]({{base_path}}/guides/users/attributes/manage-attributes/#configure-attributes).
32-
33-
3. You can either request the user to set the password or set one on the user's behalf.
34-
35-
- **Invite user to set their own password:**
36-
37-
- **Invite via email:** If this option is selected, an email with a confirmation link will be sent to the provided email address. The user can use this link to set up a new password.
38-
39-
!!! note
40-
You need to enable the **Invite user to set password** feature if you haven't done so already to use this option. Learn how to [configure invite user to set password]({{base_path}}/guides/account-configurations/user-onboarding/invite-user-to-set-password/).
41-
42-
- **Invite offline:** If this option is selected, the administrator will receive an invitation link at the end of the user registration process. This link can then be shared with the user.
43-
44-
- **Set a password for the user:** If this option is selected, the administrator can set a password for the user. The user will have the option to change this password from the [My Account Portal]({{base_path}}/guides/user-self-service/customer-self-service-portal/).
45-
46-
4. Add the user to a group in the next step. You will not see this option if you haven't created any groups in {{ product_name }}.
47-
5. Review the summary and click **Finish**.
48-
49-
!!! note
50-
If you have selected **Invite offline** or decided to **set a password for the user**, you can copy the corresponding information at the **Summary** page of the wizard and share with the user.
51-
52-
### Onboard multiple users
53-
54-
In addition to adding a single user, you can onboard multiple users at once, either manually or by using a CSV file. This is especially useful for large organizations where bulk operations can save time and reduce the effort of adding users one by one.
55-
56-
!!! note
57-
You need to enable the **Invite user to set password** feature if you haven't done so already to add multiple users. Learn how to [configure invite user to set password]({{base_path}}/guides/account-configurations/user-onboarding/invite-user-to-set-password/).
58-
59-
![Add multiple users]({{base_path}}/assets/img/guides/users/add-multiple-users-form.png){: width="800" style="display: block; margin: 0; border: 0.1px solid lightgrey;"}
60-
61-
#### Add multiple users manually
62-
63-
1. On the {{ product_name }} Console, go to **User Management** > **Users**.
64-
2. Click on the **Add User** button and select **Multiple Users** option.
65-
3. Switch to the **Manual** tab.
66-
4. Enter the email addresses of the users you want to invite. Press **Enter** after each email to add it to the list.
67-
5. Specify the groups for the users by entering the group names. Press **Enter** after each group to add it to the list.
68-
6. Click **Add** to send out the invitations.
69-
7. An email with a confirmation link will be sent to the provided email addresses, allowing the users to set their own passwords.
70-
71-
#### Add multiple users using a CSV file
72-
73-
!!! Info
74-
The default limit for maximum number of users that can be added per request using a CSV file is set to 100. To modify this limit, add the following configuration to the `<IS_HOME>/repository/conf/deployment.toml` file.
75-
76-
```
77-
[console.bulk_user_import]
78-
user_limit = 50
79-
```
80-
81-
1. On the {{ product_name }} Console, go to **User Management** > **Users**.
82-
2. Click on the **Add User** button and select **Multiple Users** option.
83-
3. Switch to the **File Based** tab.
84-
4. Click **Upload CSV File** or drag and drop a CSV file into the designated area.
85-
5. Ensure your CSV file is formatted correctly, with headers that correspond to user attributes. These attributes must be mapped to local attributes.
86-
- A sample CSV file format would include: `username, givenname, emailaddress, groups`
87-
- For example:
88-
89-
```csv
90-
username,givenname,emailaddress,groups
91-
user1,john,[email protected],group1|group2
92-
user2,jake,[email protected],group2
93-
user3,jane,[email protected],group1
94-
```
95-
96-
6. Click **Import** to add the users to the system.
97-
7. An email with a confirmation link will be sent to the provided email addresses, allowing the users to set their own passwords.
9+
To learn more about onboarding users, see [Onboard users]({{base_path}}/guides/users/onboard-users/).
9810

9911
## Assign groups
10012

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% set base_url = "https://localhost:9443" %}
2+
3+
{% include "../../../../../includes/guides/users/onboard-users.md" %}

en/identity-server/next/mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,9 @@ nav:
628628
- User management:
629629
- User management: guides/users/index.md
630630
- Manage administrators: guides/users/manage-administrators.md
631-
- Manage users: guides/users/manage-users.md
631+
- Users:
632+
- Onboard users: guides/users/onboard-users.md
633+
- Manage users: guides/users/manage-users.md
632634
- Manage groups: guides/users/manage-groups.md
633635
- Manage roles: guides/users/manage-roles.md
634636
- Manage active sessions: guides/users/manage-sessions.md

0 commit comments

Comments
 (0)