# Additional Oauth2 providers in phly-expressive-oauth2clientauthentication

**URL:** <https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069>\
**Category:** Contributors\
**Tags:** expressive\
**Created:** [May 24, 2019, 8:07pm UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069 "2019-05-24T20:07:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nynka](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nynka/32/546_2.png) [@nynka](https://discourse.laminas.dev/u/nynka)\
**Post date:** [May 24, 2019, 8:07pm UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/1 "2019-05-24T20:07:37Z")

</div>

[phly-expressive-oauth2clientauthentication](https://github.com/phly/phly-expressive-oauth2clientauthentication/) is a really handy library to authenticate against oauth2 providers. However, it’s currently limited to using only officially maintained providers from the [League OAuth2 Client](https://oauth2-client.thephpleague.com/) project, namely: Facebook, GitHub, Google, Instagram and LinkedIn.

I would like to be able to use other third party providers or my own custom one with this library so I don’t have to create my own Adapter implementation. My suggestion is that the library continues to recommend officially supported providers but somehow offers the option of registering others.

My use case is that I have a Expressive Oauth2 server using **zend-expressive-authentication-oauth2** that I have created a provider for using the conventions for third party providers of **league/oauth2-client**. And I have a Expressive client app that I want to use phly-expressive-oauth2clientauthentication in.

What do you guys think would be the best way of achieving this?

I would like to see the project continue to be actively maintained and I am happy to contribute if I can.

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [May 25, 2019, 12:39am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/2 "2019-05-25T00:39:50Z")

</div>

Why not just contributing to the upstream League OAuth2 Client?

---

<div class="post-metadata">

**Author:** ![nynka](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nynka/32/546_2.png) [@nynka](https://discourse.laminas.dev/u/nynka)\
**Post date:** [May 25, 2019, 7:28am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/3 "2019-05-25T07:28:27Z")

</div>

If you mean by putting the provider there, I will do that but it is not really useful yet because the production endpoints in it is not ready.

I thought is was a good idea of using the Authentication Adapter/Session handling in this package for my expressive client instead of reinventing the wheel?

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [May 25, 2019, 10:42am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/4 "2019-05-25T10:42:10Z")

</div>

> ![](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/1X/cbd9ada849c06f77eb1af337441f22a7fd85bfc0.png "nynka")
> 
> [nynka](https://discourse.zendframework.com/u/nynka)
> 
> ```
> May 25
> 
> ```
> 
> If you mean by putting the provider there, I will do that but it is not really useful yet because the production endpoints in it is not ready.

I don’t understand this specific bit: what does “production endpoints in it is not ready” mean, specifically?

> I thought is was a good idea of using the Authentication Adapter/Session handling in this package for my expressive client instead of reinventing the wheel?

By adding yet another client we are re-inventing the client. Why not support upstream development of the League OAuth client, and add custom endpoints there?

---

<div class="post-metadata">

**Author:** ![nynka](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nynka/32/546_2.png) [@nynka](https://discourse.laminas.dev/u/nynka)\
**Post date:** [May 25, 2019, 11:22am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/5 "2019-05-25T11:22:50Z")

</div>

> [@ocramius](#):
>
> I don’t understand this specific bit: what does “production endpoints in it is not ready” mean, specifically?

Sorry, I am not so good at explaining. 🙂 I meant the authorization urls to the oauth server in my third party provider, never mind.

> [@ocramius](#):
>
> By adding yet another client we are re-inventing the client. Why not support upstream development of the League OAuth client, and add custom endpoints there?

Yes, I guess that is the response I’m looking for as the League OAuth client supports adding custom endpoints, so should the expressive phly-expressive-oauth2clientauthentication package right?

Thank you for your feedback Marco.

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [May 25, 2019, 11:36am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/6 "2019-05-25T11:36:45Z")

</div>

> > ![](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/1X/3e8a14a2fb215eb6754e8b00b31fe5a41a7c3f6c.png) ocramius:  
> > By adding yet another client we are re-inventing the client. Why not support upstream development of the League OAuth client, and add custom endpoints there?

> Yes, I guess that is the response I’m looking for as the League OAuth client supports adding custom endpoints, so should the expressive phly-expressive-oauth2clientauthentication package right?

If it’s only about configuring League’s component, then indeed 👍

---

<div class="post-metadata">

**Author:** ![nynka](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nynka/32/546_2.png) [@nynka](https://discourse.laminas.dev/u/nynka)\
**Post date:** [May 25, 2019, 2:13pm UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/7 "2019-05-25T14:13:30Z")

</div>

Do I proceed by making a PR?

---

<div class="post-metadata">

**Author:** ![matthew](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/matthew/32/14_2.png) [@matthew](https://discourse.laminas.dev/u/matthew)\
**Post date:** [May 28, 2019, 2:43pm UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/8 "2019-05-28T14:43:40Z")

</div>

Yes, please do. Ping my github nick in a comment to the PR once you have, so I can review.

---

<div class="post-metadata">

**Author:** ![nynka](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/nynka/32/546_2.png) [@nynka](https://discourse.laminas.dev/u/nynka)\
**Post date:** [May 29, 2019, 10:59am UTC](https://discourse.laminas.dev/t/additional-oauth2-providers-in-phly-expressive-oauth2clientauthentication/1069/9 "2019-05-29T10:59:39Z")

</div>

Sure thing! [https://github.com/phly/phly-expressive-oauth2clientauthentication/pull/3](https://github.com/phly/phly-expressive-oauth2clientauthentication/pull/3)
