aboutsummaryrefslogtreecommitdiff
path: root/mu4web/user/pam.py
blob: c641ff8909f62cc11c1a3f9c5308f64afe9786bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""User authentication through PAM."""

from . import User
import pam


class PamUser(User):
    """Authenticate user through pam."""

    def validate(self, password: str) -> bool:  # noqa: 201
        ret = pam.authenticate(self._username, password)
        assert type(ret) == bool
        return ret