Skip to content

external storage locks user in AD when password has changed in AD #16724

@blizzz

Description

@blizzz

Steps to reproduce

  1. Have LDAP/AD configured as well as user specific SMB share with AD credentials (saved in DB)
  2. Log in at least once, close the browser
  3. Change the password in AD
  4. Let cron jobs do their things

Expected behaviour

  • Have only one attempt that ends up with unauthenticated, or introduce a big delay

Actual behaviour

  • The storage is marked unavailable (for hard 10 minutes)
  • The next attempt to authenticate follows
  • dependent on the policy on AD a lock will follow

Options

Let me state first state that this mechanism follows not a modern approach but sadly is still adopted in many places.

Background: on an attempt with an invalid password, SMB Storage throws a ConnectError with "Invalid login"

  • The workaround: configurable RECHECK_TTL_SEC in config.php – the hard 10 minutes could be increased by admins
  • The other timestamp: extended the database and setting when the storage is available again. On certain types of errors, it could be more than the 10 minutes, e.g. 8 hours for this type of exception. Still a static time, but probably sufficient. It is required to extend the database table however. Still can include the config.php option if necessary.
  • The full blown: like before, with another column that counts "bad attempts" so that the time interval increases each time.
  • The awkward workaround: sets the time checked timestamp to the future on ConnectError exceptions to achieve the same result as in the second option. The advantage is that no DB changes are needed, but comes with ugliness.

Better backportability comes without DB changes, espcially if they can be time costly. Therefore, as bad as it sounds, the last option has a good balance of flexibility and complexity. What do you think @icewind1991

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions