You are right. My original code had more specific GoogleOAuth 2.0 service
but I did not want to alter your implementation too much. And I wanted to
make it more generic for other providers as well. One solution would be to
create OpenIdOaut20Service class and then GoogleService20 will override it.
If some other provider starts to support it, we can easily switch its
parent class. Shall I reimplement it this way?


2014-03-13 12:50 GMT+01:00 Stas Gromov <notifications@github.com>:

> In src/main/java/org/scribe/extractors/JsonTokenExtractor.java:
>
> > @@ -8,14 +8,20 @@
> >
> >  public class JsonTokenExtractor implements AccessTokenExtractor {
> >    private Pattern accessTokenPattern = Pattern.compile("\"access_token\"\\s*:\\s*\"(\\S*?)\"");
> > +  private Pattern idTokenPattern = Pattern.compile("\"id_token\"\\s*:\\s*\"(\\S*?)\"");
>
> JsonTokenExtractor is a common Extractor for a lot of OAuth Providers.
> It's not nice to modify it to support non-OAuth extension of only one
> Provider.
> What's wrong with creating subclass "GoogleApi20JsonTokenExtractor"?
> Rename later to "OpenIDJsonTokenExtractor" may be.
> I'm planning to create maven submodules. Core module and Apis modules. In
> that case, core module shouldn't know anything about OpenID, until OpenID
> token in response becomes a part of the OAuth specifications.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/hhru/subscribe/pull/1/files#r10561034>
> .
>