Skip to content

Multi-auth. provider / using separate DBs for usernames and passwords. #56

Closed
@foxcpp

Description

@foxcpp

I remember having a use-case where I wanted to give email accounts to all PAM users but use passwords from a separate database. And also people on IRC channels for dovecot and postfix often ask questions regarding weird mixes of authentication data sources. So I guess we should have a generic tool to handle such cases.

We create the multi module that implements authentication provider interface (so it can be used in SMTP, IMAP, etc):

multi instance_name {
  user pam
  user virtual { file /etc/maddy/userlist }
  pass virtual { file /etc/maddy/passwd }
}

user directive here refers to a module implementing the following interface:

type UserDB interface {
  HasUser(name string) bool
}

pass directive refers to an authentication provider.

If there is at least one user directive - then at least one "userdb" module should say that the user exists.
Then the user password is also checked against providers listed using pass directives, at least one provider should accept the password.

multi module itself also implements the UserDB interface, this allows mixing things together in more complicated use-cases to get the right results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to authentication providersnew featureNew feature.rfcRequest For Comments (ongoing discussion / research needed).

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions