-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
cbd5a34
commit 00631fd
Showing
24 changed files
with
440 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/) | ||
|
Oops, something went wrong.