This may not be a bug and works as designed. Upon authentication, a Drupal user account is created regardless of the Who can register accounts? is configured to Administrators only.
Steps to Reproduce
* Standard installation
* As site admin, navigate to /admin/config/people/accounts and configure Who can register accounts? option as Administrators only.
* Enable and configure openid_connect with Google OpenID Connect client.
* Configure login block to display
* As anonymous user, navigate to sight and authenticate using Login with Google button
* After authentication, Drupal user account created.
Expected Behavior
* Respect Who can register accounts? or some warning on the configuration page at /admin/config/services/openid-connect path.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | respect_registration-2838149-7.patch | 3.34 KB | sanduhrs |
Comments
Comment #2
jasonawantAh, I there is a D7 issue, so this might be a duplicate issue of that.
https://www.drupal.org/node/2579999
Comment #3
sanduhrsPatches welcome.
Comment #4
cruno commentedAdding patch that takes care of this, but also includes the work from here: Unable to use OpenID Connect to authenticate with an existing Drupal user account
This way users who Administrators have already created accounts for can still log in.
Comment #5
jasonawantSetting to needs to review to get feedback from module maintainer
Comment #6
sanduhrs@cruno please do one patch at a time.
Thanks for contributing!
Comment #7
sanduhrsMy take at a patch focused on registration settings only.
Taking into account all three states:
* USER_REGISTER_ADMINISTRATORS_ONLY
* USER_REGISTER_VISITORS
* USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL
Patch attached, please review.
Comment #9
sanduhrs