Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill basic info for users auto-created using a reverse proxy #2498

Open
Kegeruneku opened this issue Jan 28, 2016 · 6 comments
Open

Fill basic info for users auto-created using a reverse proxy #2498

Kegeruneku opened this issue Jan 28, 2016 · 6 comments
Labels
🎯 feature Categorizes as related to a new feature 🙇‍♂️ help wanted Need your help

Comments

@Kegeruneku
Copy link

As quoted from #165 :

Greetings @unknwon !

I would also be interested in having a way to have a way to fill basic info about the user auto-created by ENABLE_REVERSE_PROXY_AUTO_REGISTRATION.

As said by previous commenters, it could either be passed using http headers, or if available using a configured LDAP provider (this is what others application usually do when applicable)

The use case is simple: I would love to at least have the correct mail for the user so he/she does not have to redefine profile info after initial login. (it is needed for mails to be sent in case of updates and having to redefine it is tedious especially when the info is actually already available somewhere)

The user first name / last name would be a bonus (if possible, but the mail is more important)

I'll be around if you need precisions :)

@unknwon unknwon added the 🎯 feature Categorizes as related to a new feature label Jan 28, 2016
@unknwon unknwon added this to the 0.9.0 milestone Jan 28, 2016
@unknwon
Copy link
Member

unknwon commented Jan 28, 2016

Thanks your feedback!

@unknwon unknwon added the 🙇‍♂️ help wanted Need your help label Jan 28, 2016
@Kegeruneku
Copy link
Author

Also, it might be a good idea to be able to set a default identification provider for newly created users, in case the user that was auto created comes from an identification provider known to Gogs (a LDAP server, maybe). This way, you would be able to provision automatically all user details

I think the best approach would be, in case a new user unknown to Gogs just authenticated using headers, to search for this user in the configured authentication providers, and if the user is not found fallback to what Gogs already does: create a local user with a randomly generated password and mail.

The bonus point would be a setting to tell gogs if a user can not be found in the authentication backend, to refuse the login, but it's not really necessary in a first iteration

@unknwon
Copy link
Member

unknwon commented Feb 1, 2016

Thanks for your comments!

Just want to point out that the basic rule of this feature is: everything come from header is valid, no check process should be performed by Gogs. This is my understanding...

@unknwon unknwon removed this from the 0.9.0 milestone Feb 7, 2016
@dortamur
Copy link

We've started to use Gogs for our team's code archive, and this feature would be great! While we could use an LDAP source for the extra user identity data, getting the core fields from headers provided by the Auth proxy would be fine for us (and simpler).

@sid3windr
Copy link

I'd greatly prefer to keep everything inside GOGS; it's nice that accounts are now autocreated but they are indeed missing the name and e-mail fields currently. It would be nice to have a "default provider" for that (i.e. a configured LDAP auth backend), and have it pull the user's data from that backend upon creation.

I think we'll make do for now with an outside script that fills in missing data for e-mails ending in @localhost.

@elvarb
Copy link

elvarb commented Nov 30, 2017

having a setting to define the default created passwords would help

ENABLE_REVERSE_PROXY_AUTO_REGISTRATION_EMAIL = X-Forwarded-Email

or

ENABLE_REVERSE_PROXY_AUTO_REGISTRATION_EMAILNAME = X-Forwarded-User
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION_EMAILDOMAIN = "company.com"

pboguslawski added a commit to ibpl/gitea that referenced this issue Sep 28, 2020
Gitea allows autocreation of account from external source after successful
basic auth but not after successful reverse proxy auth. This mod adds such
feature.

Unfortunaltely gitea does not sync all user attributes from LDAP for
existing users on login like cron.sync_external_users does so changes
of first name, surname, e-mail are not updated from LDAP on login for
exiting users - only after first login and after sync_external_users task.

Related: gogs/gogs#2498
Author-Change-Id: IB#1104925
pboguslawski added a commit to ibpl/gitea that referenced this issue Sep 28, 2020
LDAP account synchronization added after reverse proxy authentication.

Related: gogs/gogs#2498
Author-Change-Id: IB#1104925
pboguslawski added a commit to ibpl/gitea that referenced this issue Sep 28, 2020
Fixed LDAP account synchronization after reverse proxy authentication
when user already exits.

Related: gogs/gogs#2498
Author-Change-Id: IB#1104925
pboguslawski added a commit to ibpl/gitea that referenced this issue Jan 29, 2022
Gitea allows autocreation of account from external source after successful
basic auth but not after successful reverse proxy auth. This mod adds such
feature.

Unfortunaltely gitea does not sync all user attributes from LDAP for
existing users on login like cron.sync_external_users does so changes
of first name, surname, e-mail are not updated from LDAP on login for
exiting users - only after first login and after sync_external_users task.

Related: gogs/gogs#2498
Author-Change-Id: IB#1104925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature 🙇‍♂️ help wanted Need your help
Projects
None yet
Development

No branches or pull requests

5 participants