Restore PAM user autocreation functionality (#15825)

* Restore PAM user autocreation functionality

PAM autoregistration of users currently fails due to email invalidity.
This PR adds a new setting to PAM to allow an email domain to be set
or just sets the email to the noreply address and if that fails falls
back to uuid@localhost

Fix #15702

Signed-off-by: Andrew Thornton <art27@cantab.net>

* As per KN4CKER

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2021-05-13 23:11:47 +01:00 committed by GitHub
parent 9545c345a8
commit d234d37aa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 1 deletions

View file

@ -240,6 +240,7 @@ func NewAuthSourcePost(ctx *context.Context) {
case models.LoginPAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
EmailDomain: form.PAMEmailDomain,
}
case models.LoginOAuth2:
config = parseOAuth2Config(form)
@ -347,6 +348,7 @@ func EditAuthSourcePost(ctx *context.Context) {
case models.LoginPAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
EmailDomain: form.PAMEmailDomain,
}
case models.LoginOAuth2:
config = parseOAuth2Config(form)