For projects and continuos integration of community we need a central Drupal authentication provider.
The project https://www.drupal.org/project/oauth2_server is capable of facilitating this.
We use it in in daily practice for SSO openID Connect sytems.
This request is just to validate if a user with a d.o. entity is valid in drupal.org?

Implementation

  • Install stable versions of xautoload, oauth2_server
  • sites/all/libraries/oauth2-server-php should be https://github.com/bshaffer/oauth2-server-php/releases/tag/v1.8.0
  • Grant permission to all - use_oauth2_server
  • Create OAuth2 Server, export Feature once this is set well
  • Create client(s) as-needed
    • client-id will be visible in the URL
    • client-secret should only be know by d.o. and the implementer of the Openid client consumer. (e.a. this is a crypto secret)

Additional Notes

  • The oauth endpoints are on [drupal]/oauth2/{token|authenticate|UserInfo}.
  • Token and authentication endpoints can have short valid times, but should be long enough for slow connections.
  • `Refresh token lifetime` is mainly used for "offline access" scopes.

Comments

idevit created an issue. See original summary.

drumm’s picture

This is something we’ve been looking at for integrating 3rd party services, but these haven’t gotten quite to production yet.

oauth2_server is the most promising implementation I’ve seen. A thorough security review of the module would be great.

I’m curious how continuous integration might use this.

A hesitation for opening something like this to the world is handling support issues which will come up.

florisg’s picture

Yes this continuous integration is completely different then any industry proven standard.
Its a continuous community integration where Camps and local foundations can validate that this person has a drupal.org account and is a community member.

No more is needed, people fill their profiles.

kraut’s picture

@drumm After speaking at DrupalCon Vienna in a BoF about it, what's the current status and internal planing on this?
How can the Drupal community help and support the infrastructure team here?

C-Logemann’s picture

Because of a related discussion on drupalchat.eu where such an authentication was mentioned as an "anti spam" solution we should maybe filter on "confirmed" user role.

drumm’s picture

I still haven’t seen a security review of the project.

sanduhrs’s picture

Is this just installing oauth2_server on d.o or would we go and deploy a separate instance just doing the authentication?

C-Logemann’s picture

@sanduhrs A Subdomain like "openid.drupal.org" with a D7 System and bakery-module would be possible. Maybe not good for usability but easier to accept for d.o infrastructure maintainers.

sanduhrs’s picture

D7 because of the bakery dependency?

C-Logemann’s picture

@sanduhrs Yes that was the idea. But maybe the D8 version of bakery can be pushed forward. By myself I'm not very motivated to push bakery because I like the openId/oauth2 way. But bakery is already used on d.o infrastructure as far as I know. So this can be a way to push oauth2 via a bakery solution :-)

florisg’s picture

No, bakery is only within same tld.

This issue is deliberately set against oauth2_server module for its d7 and d8 available.
Code seems viable to me, it needs a formal security audit.

Implementing clients is not an issue, we've done that for d7 and d8.

This way we can authenticate against drupal.org for all camps and conferences.
So we are able address the user to (already) be involved into our community.

Perhaps in the near future easy profile with OpenID Connect.
Scope for now is just: Oauth2 user authentication.

C-Logemann’s picture

Maybe my suggestion above is not good explained. When the d.o-Maintainers currently don't want a direct implementation of an oauth2 endpoint on drupal.org there is possibly an chance to to run a bridging system. For the bridge we need a subdomain like "openid.drupal.org" which is connected via bakery to drupal.org. For the other side the bridge system can provide an openid/oauth2 endpoint to connect other systems like "drupalchat.eu". To realize this we also need support of d.o-maintainers e.g. for getting a subdomain. With this workaround we can move on and maybe this helps to get finally the endpoint directly implemented on drupal.org.

In the past it was easy to connect community sites to drupal.org e.g. the german forum "drupalcenter.de" via bakery. This community feature was gone because of security. Maybe in future there will rise another security problem with using cookies and bakery will be not working any more in d.o-infrastructure. Because of this risk it's a good decision to early start testing and improving an openid/oauth2 solution as an alternative to connect "groups.drupal.org" and other *.d.o systems. And finally I really like to get back the community feature "login via drupal.org".

hestenet’s picture

@C_Logemann - Just to clarify - the D.O maintainers (including myself) actually do want a direct implementation of an Oauth2 endpoint. We're working on a review of the existing available modules from a functionality and security perspective this sprint and hope to be working on this over the next several sprints. So hopefully we do not need to rely on a more complicated work around to make this happen.

drumm’s picture

In the past it was easy to connect community sites to drupal.org e.g. the german forum "drupalcenter.de" via bakery. This community feature was gone because of security.

The old system actually predated bakery, it was Drupal’s XML-RPC implementation, https://www.drupal.org/node/1105470. And yes, it had some big security issues.

sanduhrs’s picture

@drumm If a security review is needed, I will see what I can come up with.

Are there other ways to bring this forward?

drumm’s picture

drumm’s picture

Need to update the issue summary with recommended OAuth2 servers config, like various token lifetimes.

sysosmaster’s picture

So I recommend the following timeout times:

  • Access token lifetime: 300
  • ID token lifetime 300
  • Refresh token lifetime 3600
sysosmaster’s picture

Issue summary: View changes
gauravmishra7’s picture

This would be really helpful especially with respect to different DrupalCamps using different logins; which becomes a nuisance to manage.

jdleonard’s picture

The ability for DrupalCamp websites and other services serving the Drupal community to offer SSO would promote participation in drupal.org while improving security for users and the Drupal community (e.g. by avoiding identical passwords being used across services and reducing attack surfaces of other services).

If a service (e.g. a DrupalCamp website) had the ability to discover whether a given user has a Drupal Association membership, it could also empower services to more actively upsell users on DA memberships or offer perks to DA members (e.g. reduced admission).

There was talk at some point of the NYC Drupal community seeking individual memberships to help fund its programming and build community. It would be great for DrupalNYC and other local organizations to be able to require (and seamlessly validate) DA membership as a prerequisite for local association membership to avoid unintentionally redirecting membership dollars from the DA to the local associations.

greggles’s picture

Title: Oauth2 endpoint » Providing an Oauth2 endpoint from drupal.org
Component: Continuous Integration » Other
Related issues: +#3049462: Roadmap for a stable release?

Making the title more explicit for better searchability.

Is anyone aware of an oauth server module for Drupal that has been used in an environment that got a security audit?

I think #3049462: Roadmap for a stable release? would be great to finish along with the launch.

colan’s picture

I'm wondering if Simple OAuth (OAuth2) & OpenID Connect may be the better choice now given what was written in #3198714: Migrate to the League's PHP Library. I didn't see a security-review issue in that queue, however, like there is for OAuth2 Server: #3038634: Security review, which actually points here.

Kingdutch’s picture

As the person who created the story that suggests the OAuth2 Server module should migrate to the new library. Please be aware that the two modules have a different security model.

OAuth2 Server only allows the intersection of a user's permission and the application's scopes. (My personal view is that this is what you expect with OAuth).

Simple OAuth in contrast sets the permissions of the user to that of the scopes provided to the accessing applications. This can give the user fewer capabilities but it can also give the user more capabilities. As outlined in #3077125: Consumers should not be able to grant roles beyond those already assigned to user by the module maintainer, this behavior is by design.

Depending on the use-case, the model in Simple OAuth may or may not work for you.

florisg’s picture

This should be up and running by now, its taken 5 years.
How about giving this technology a spin.

hestenet’s picture

We are actually getting pretty close to deploying KeyCloak as an OAuth solution. We are in the phase of testing user migrations now.

There have been many barriers along the way, for example, until only a month or two ago KeyCloak did not support two factor recovery codes. We've been working with upstream on things like this to get to this point.