Skip to content

Commit

Permalink
v4.5 - IBX-6744 Sort and design user section of the documentation (#2254
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MagdalenaZuba authored Dec 22, 2023
1 parent cbd5a34 commit 00631fd
Show file tree
Hide file tree
Showing 24 changed files with 440 additions and 398 deletions.
2 changes: 1 addition & 1 deletion docs/commerce/storefront/configure_storefront.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ interface CatalogResolverInterface

The following user settings mechanisms used in `ibexa/storefront` are reused from `ibexa/user` package:

- [change password feature](user_management.md)
- [change password feature](passwords.md)
- user avatar

Settings for a Storefront user are configured under the `ibexa.system.<scope>.storefront.user_settings_groups` [configuration key](configuration.md#configuration-files):
Expand Down
2 changes: 1 addition & 1 deletion docs/customer_management/create_user_registration_form.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ First, make sure you [enabled user registration](permission_use_cases.md#registe
In your configuration, under `allowed_field_definitions_identifiers` [configuration key](configuration.md#configuration-files),
specify the fields that should be part of your registration form.
You can also define what kind of user you want to create under `user_type_identifier` e.g. frontend user.
To learn more about available users, see [user types documentation](user_management.md#user-types).
To learn more about available users, see [user types documentation](user_registration#user-types).

``` yaml
ibexa:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/first_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = [ eZConfig, ibexaConfig, ...customConfigs ];

Make sure that you change the default password before you switch your installation
from development to production.
For more information about passwords, see [Passwords](user_management.md#passwords).
For more information about passwords, see [Passwords](passwords.md).
For more information about production security, see [Security checklist](security_checklist.md).

2\. Select Admin and go to Content Types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you want to use this feature, you must at least extend the login template in

Symfony provides native support for [multiple user providers]([[= symfony_doc =]]/security/multiple_user_providers.html). This makes it easy to integrate any kind of login handlers, including SSO and existing third-party bundles (e.g. [FR3DLdapBundle](https://github.com/Maks3w/FR3DLdapBundle), [HWIOauthBundle](https://github.com/hwi/HWIOAuthBundle), [FOSUserBundle](https://github.com/FriendsOfSymfony/FOSUserBundle), [BeSimpleSsoAuthBundle](http://github.com/BeSimple/BeSimpleSsoAuthBundle), etc.).

See [Authenticating a user with multiple user provider](user_management.md#authenticate-user-with-multiple-user-providers) for more information.
See [Authenticating a user with multiple user provider](user_authentication.md#authenticate-user-with-multiple-user-providers) for more information.

## JWT authentication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This is specially important for admin accounts and other privileged users.

!!! tip "Password rules"

See [setting up password rules](user_management.md#password-rules).
See [setting up password rules](passwords.md#password-rules).

### Secure secrets

Expand Down
2 changes: 1 addition & 1 deletion docs/release_notes/ez_platform_v3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ The `keyword` Field Type can now recognize versions of a Content item.

#### Login by User name or email

You can now give your users th ability to [log in with User name or with email](https://doc.ibexa.co/en/latest/guide/user_management/user_management/#login-methods).
You can now give your users th ability to [log in with User name or with email](https://doc.ibexa.co/en/latest/users/login_methods).

#### Password rules

Expand Down
2 changes: 1 addition & 1 deletion docs/templating/layout/add_forgot_password_option.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ which users receive after they request a password change.
The [default templates](https://github.com/ibexa/user/tree/main/src/bundle/Resources/views) for forgot password form and email are located in `ibexa/user/src/bundle/Resources/views`.
The [templates](https://github.com/ibexa/admin-ui/tree/main/src/bundle/Resources/views/themes/admin/account/forgot_password) specific for the Back Office are in `ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account`.

You can also modify [other user management templates](user_management.md#other-user-management-templates).
You can also modify [other user management templates](user_registration.md#other-user-management-templates).

To add a link redirecting to the reset password form, in the page layout template, provide the following code:

Expand Down
6 changes: 3 additions & 3 deletions docs/templating/layout/add_login_form.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description: Customize the login form for new users in your site front end.
# Add login form

You can create a login form for your users.
Follow the instruction below to create a template with login form. If you want to configure more options for example, password expiration, see [other user management templates](user_management.md#other-user-management-templates).
Follow the instruction below to create a template with login form. If you want to configure more options for example, password expiration, see [other user management templates](user_registration.md#other-user-management-templates).

First, make sure you have configured [login methods](user_management.md#login-methods).
First, make sure you have configured [login methods](login_methods.md).

If you only want to change a template, add the following configuration under the `ibexa.system.<scope>.user` [configuration key](configuration.md#configuration-files):

Expand Down Expand Up @@ -52,7 +52,7 @@ In `templates/themes/<theme_name>/login`, create an `expired_credentials.html.tw
## Customize login form

You can use a custom template for example to display information about password expiration
or to customize [other user management templates](user_management.md#other-user-management-templates).
or to customize [other user management templates](user_registration.md#other-user-management-templates).

In case of more advanced template customization, you can use a subscriber,
for example in `src/EventSubscriber/LoginFormViewSubscriber.php`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ The User you have just created will have the Roles assigned to this group.
!!! tip

You can change the group in which new Users are placed (but you don't need to do it for this tutorial).
See [Registering new users](user_management.md#registering-new-users) for more information.
See [Registering new users](user_registration.md) for more information.

At this point you don't want anyone who registers to be able to add content to the website.
That's why you'll create a new User Group with additional permissions.
Expand Down
2 changes: 1 addition & 1 deletion docs/update_and_migration/from_3.3/update_from_3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ On Experience or Commerce edition, run the following scripts:

Following [Security advisory: IBEXA-SA-2022-009](https://developers.ibexa.co/security-advisories/ibexa-sa-2022-009-critical-vulnerabilities-in-graphql-role-assignment-ct-editing-and-drafts-tooltips),
unless you can verify based on your log files that the vulnerability hasn't been exploited,
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/user_management/#revoking-passwords) for all affected users.
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/passwords/#revoking-passwords) for all affected users.

### v3.3.34

Expand Down
2 changes: 1 addition & 1 deletion docs/update_and_migration/from_4.1/update_from_4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If you have no access to [[= product_name =]]'s `ibexa/installer` package, datab

Following [Security advisory: IBEXA-SA-2022-009](https://developers.ibexa.co/security-advisories/ibexa-sa-2022-009-critical-vulnerabilities-in-graphql-role-assignment-ct-editing-and-drafts-tooltips),
unless you can verify based on your log files that the vulnerability has not been exploited,
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/user_management/#revoking-passwords) for all affected users.
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/passwords/#revoking-passwords) for all affected users.

### Remove `node_modules` and `yarn.lock`

Expand Down
2 changes: 1 addition & 1 deletion docs/update_and_migration/from_4.2/update_from_4.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ If you have no access to [[= product_name =]]'s `ibexa/installer` package, datab

Following [Security advisory: IBEXA-SA-2022-009](https://developers.ibexa.co/security-advisories/ibexa-sa-2022-009-critical-vulnerabilities-in-graphql-role-assignment-ct-editing-and-drafts-tooltips),
unless you can verify based on your log files that the vulnerability has not been exploited,
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/user_management/#revoking-passwords) for all affected users.
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/passwords/#revoking-passwords) for all affected users.

## Finish update

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ If you have no access to [[= product_name =]]'s `ibexa/installer` package, datab

Following [Security advisory: IBEXA-SA-2022-009](https://developers.ibexa.co/security-advisories/ibexa-sa-2022-009-critical-vulnerabilities-in-graphql-role-assignment-ct-editing-and-drafts-tooltips),
unless you can verify based on your log files that the vulnerability has not been exploited,
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/user_management/#revoking-passwords) for all affected users.
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/passwords/#revoking-passwords) for all affected users.

## Finish code update

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ If you have no access to [[= product_name =]]'s `ibexa/installer` package, datab

Following [Security advisory: IBEXA-SA-2022-009](https://developers.ibexa.co/security-advisories/ibexa-sa-2022-009-critical-vulnerabilities-in-graphql-role-assignment-ct-editing-and-drafts-tooltips),
unless you can verify based on your log files that the vulnerability has not been exploited,
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/user_management/#revoking-passwords) for all affected users.
you should [revoke passwords](https://doc.ibexa.co/en/latest/users/passwords/#revoking-passwords) for all affected users.

## Finish code update

Expand Down
2 changes: 1 addition & 1 deletion docs/users/customer_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For example, you can offer a 10% discount for all products in the catalog to use

!!! tip

Note that customer groups are not the same as [User Groups](user_management.md#user-groups).
Note that customer groups are not the same as [User Groups](user_registration.md#user-groups).
User Groups concern all users in the system and can be used, for example, to handle permissions.
Customer groups refer specifically to the commerce functionalities and enable handling prices.

Expand Down
2 changes: 2 additions & 0 deletions docs/users/invitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ Here, you can specify which template should be used for the invitation mail,
and what should be the expiration time for the invitation link included in that mail.
If a user does not click the invitation link sent to them in time, you can refresh the invitation.
Refresh resets the time limit and changes the hash in the invitation link.
You can find more registration related templates in [Register new users documentation](user_registration.md#other-user-management-templates).
64 changes: 64 additions & 0 deletions docs/users/login_methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
description: Set up user login methods.
---

# Login methods

Two login methods are available: with User name or with email.

Providers for these two methods are `ibexa.security.user_provider.username`
and `ibexa.security.user_provider.email`.

You can configure which method is allowed under the `security` [configuration key](configuration.md#configuration-files):

``` yaml
security:
providers:
ibexa:
chain:
providers: [ibexa_username, ibexa_email]

ibexa_username:
id: ibexa.security.user_provider.username

ibexa_email:
id: ibexa.security.user_provider.email

firewalls:
#...
ibexa_front:
# ...
provider: ibexa
```
You can customize per User Field whether the email address used as a login method must be unique or not.
To check that all existing User accounts have unique emails,
run the `ibexa:user:audit-database` command.
It lists all User accounts with duplicate emails.

!!! caution

Because logging in with email was not available until version v3.0,
you can come across issues if you use the option on an existing database.

This may happen if more than one account uses the same email address.
Login through the User name will still be available.

To resolve the issues, run `ibexa:user:audit-database`
and manually modify accounts that have duplicate emails.

## Login rules

You can set the rules for allowed User names in the Back Office per User Field.

The rules are set using regular expressions.

For example, to ensure that User names can only contain lowercase letters,
set `[a-z]+$` as **Username pattern**:

![Setting a User name pattern](username_pattern.png)

To check that all existing User accounts have names that fit the current pattern,
run the `ibexa:user:audit-database` command.
It checks all User accounts in the database and list those that do not fit the pattern.
119 changes: 119 additions & 0 deletions docs/users/passwords.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
description: Set up user password rules.
---

## Passwords

## Changing and recovering passwords

The user may request to change their password, or may forget it and ask to have it reset.

To change password, the user must have the `user/password` permission.

When the user requests a reset of a forgotten password, an email is sent to them with a token.
It allows them to create a new password.

For information about how to create and configure the template, see [Add forgot password option](add_forgot_password_option.md)

The template for this email is located in `Resources/views/forgot_password/mail/forgot_user_password.html.twig` in `ibexa/user`.
You can [customize it according to your needs](add_login_form.md#customize-login-form).

The validity of the password recovery token can be set using the `ibexa.system.<siteaccess>.security.token_interval_spec` parameter.
By default, it is set to `PT1H` (one hour).

## Revoking passwords

In case of a security situation such as a data leakage, you may need to force users to change their passwords.
You can do it with the help of the `ibexa:user:expire-password` command,
which revokes the passwords for specific users, User Groups or users belonging to the chosen Content Type.

To select which users to revoke passwords for, use one of the following options with the command:

- `--user-id|-u` - the ID of the user. Accepts multiple user IDs
- `--user-group-id|-ug` - the ID of the user group. Accepts multiple group IDs
- `--user-content-type-identifier|-ct` - the identifier of the user Content Type. Accepts multiple Content Types

You can use the following additional options with the command:

- `--force|-f` - commits the change, otherwise the command only performs a dry run
- `--iteration-count|-c` - defines how many users are fetched at once. Lowering this value helps with memory issues
- `--password-ttl|-t` - number of days after which new passwords expire. Used when the command enables password expiration for user Content Types that do not use it yet.

For example, to revoke the passwords of all users of the `user` Content Type, run:

``` bash
php bin/console ibexa:user:expire-password --user-content-type-identifier=user --force
```

To perform a dry run (without saving the results) of revoking passwords of all users from user group 13, run:

``` bash
php bin/console ibexa:user:expire-password --user-group-id=13
```

## Password rules

You can customize the password policy in your project.
Each password setting is customizable per User Field Type.
You can change the [password attributes](#password-attributes) or [password expiration settings](#password-expiration), and determine the rules for [repeating passwords](#repeating-passwords).

To access the password settings:

1. In the Back Office, in the **Admin** Panel, open the **Content Types** tab.
1. In the **Content Type groups** table, click on **Users**.
1. Edit the User Content Type.
1. In the **Field definitions** list, view the settings for **User account (ezuser)**.

!!! tip

There can be other Content Types that function as users, beyond the built-in User Content Type.
For details, see [User Identifiers](repository_configuration.md#user-identifiers).

### Password attributes

In the **User account (ezuser)** Field definition, you can determine if the password must contain at least:

- One uppercase letter
- One lowercase letter
- One number
- One non-alphanumeric character

You can also set the minimum password length.

### Password expiration

In the **User account (ezuser)** Field definition, you can set password expiration rules, which forces users to change their passwords periodically.

![Password expiry settings](password_expiry.png)

You can also decide when the user is notified that they need to change their password.
The notification is displayed in the Back Office after login and in the User Content item's preview.

### Repeating passwords

You can set a rule that the password cannot be reused.
You set it for the User Content Type in the **User account (ezuser)** Field Type's settings.
When this is set, the user cannot type in the same password when it expires.
It has to be changed to a new one.

This only checks the new password against the current one.
A password that has been used before can be used again.

This rule is valid by default when password expiration is set.

### Breached passwords

You can set a rule that prevents using passwords which have been exposed in a public breach.
To do this, in the **User account (ezuser)** Field definition, select "Password must not be contained in a public breach".

![Protection against using breached passwords](password_breached.png)

This rule checks the password against known password dumps by using the https://haveibeenpwned.com/ API.
It does not check existing passwords, so it won't block login for anyone. It applies only to new passwords when users change them.

!!! note

The password itself isn't sent to the https://haveibeenpwned.com/ API, which makes this check secure.
For more information on how that is possible,
see [Validating Leaked Passwords with k-Anonymity.](https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/)

Loading

0 comments on commit 00631fd

Please sign in to comment.