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.

Comments

jasonawant created an issue. See original summary.

jasonawant’s picture

Ah, I there is a D7 issue, so this might be a duplicate issue of that.

https://www.drupal.org/node/2579999

sanduhrs’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev
Category: Bug report » Feature request

Patches welcome.

cruno’s picture

Adding 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.

jasonawant’s picture

Status: Active » Needs review

Setting to needs to review to get feedback from module maintainer

sanduhrs’s picture

Status: Needs review » Needs work

@cruno please do one patch at a time.
Thanks for contributing!

sanduhrs’s picture

Status: Needs work » Needs review
StatusFileSize
new3.34 KB

My 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.

  • sanduhrs committed 94e5d3d on 8.x-1.x
    Issue #2838149 by sanduhrs, cruno: Respect Registration Account Setting
    
sanduhrs’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.