<div dir="ltr">Thanks for you quick reply, Marek! <div><br></div><div>When re-reading the documentation now I see the part on enabling the Google+ API in the Google Developer console, which I apparently didn&#39;t pay attention to. It all works smoothly now, and I can remove the user-defined OpenId Connect provider.</div><div><br></div><div><br></div><div>Regards,</div><div>Sigbjørn</div><div class="gmail_extra"><br><div class="gmail_quote">On 10 August 2016 at 11:49, Marek Posolda <span dir="ltr">&lt;<a href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Did you enable Google+ API in Google
      admin console? Configuration of this is on Google side, not scopes
      on Keycloak side on identityProvider page.<br>
      <br>
      Marek<div><div class="h5"><br>
      <br>
      On 10/08/16 10:47, Sigbjørn Dybdahl wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>I&#39;m trying to configure an instance of Keycloak using
          version 2.1.0.CR1 and I&#39;ve run into a problem when using the
          Google Identity Provider with the default configuration. That
          is, during the callback I observe
          a org.keycloak.broker.<wbr>provider.<wbr>IdentityBrokerException: Could
          not fetch attributes (see complete stacktrace below for
          details) from userinfo endpoint which seems to be linked to
          the 403 Forbidden return code when calling <a href="https://www.googleapis.com/plus/v1/people/me/openIdConnect" target="_blank"></a><a href="https://www.googleapis.com/plus/v1/people/me/openIdConnect" target="_blank">https://www.<wbr>googleapis.com/plus/v1/people/<wbr>me/openIdConnect</a>. </div>
        <div><br>
        </div>
        <div>This seems to be similar to <a href="https://issues.jboss.org/browse/KEYCLOAK-2942" target="_blank">https://issues.jboss.org/<wbr>browse/KEYCLOAK-2942</a>,
          but even when adding the additional Google+ scopes (making
          scope=openid profile email <a href="https://www.googleapis.com/auth/plus.me" target="_blank">https://www.googleapis.com/<wbr>auth/plus.me</a>
          <a href="https://www.googleapis.com/auth/plus.login" target="_blank">https://www.googleapis.com/<wbr>auth/plus.login</a>)
          the call fails. As for JIRA-2942, I&#39;ve tried setting up a
          user-defined OpenId Connect provider with the default scope,
          which works just fine.</div>
        <div><br>
        </div>
        <div>Have I forgotten any important parameter while configuring
          the standard Google support? Or is this a regression for this
          release?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Sigbjørn Dybdahl</div>
        <div><br>
        </div>
        <div>---</div>
        <div><br>
        </div>
        <div>Here&#39;s the complete stacktrace for the exception:</div>
        <div>
          <div><br>
          </div>
          <div>
            <div>20:07:12,247 ERROR
              [org.keycloak.broker.oidc.<wbr>AbstractOAuth2IdentityProvider<wbr>]
              (default task-20) Failed to make identity provider oauth
              callback:
              org.keycloak.broker.provider.<wbr>IdentityBrokerException:
              Could not fetch attributes from userinfo endpoint.</div>
            <div>    at
org.keycloak.broker.oidc.<wbr>OIDCIdentityProvider.<wbr>getFederatedIdentity(<wbr>OIDCIdentityProvider.java:304)</div>
            <div>    at
org.keycloak.broker.oidc.<wbr>AbstractOAuth2IdentityProvider<wbr>$Endpoint.authResponse(<wbr>AbstractOAuth2IdentityProvider<wbr>.java:230)</div>
            <div>    at
              sun.reflect.<wbr>NativeMethodAccessorImpl.<wbr>invoke0(Native
              Method)</div>
            <div>    at
sun.reflect.<wbr>NativeMethodAccessorImpl.<wbr>invoke(<wbr>NativeMethodAccessorImpl.java:<wbr>62)</div>
            <div>    at
sun.reflect.<wbr>DelegatingMethodAccessorImpl.<wbr>invoke(<wbr>DelegatingMethodAccessorImpl.<wbr>java:43)</div>
            <div>    at java.lang.reflect.Method.<wbr>invoke(Method.java:498)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>MethodInjectorImpl.invoke(<wbr>MethodInjectorImpl.java:139)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceMethodInvoker.<wbr>invokeOnTarget(<wbr>ResourceMethodInvoker.java:<wbr>295)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceMethodInvoker.invoke(<wbr>ResourceMethodInvoker.java:<wbr>249)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceLocatorInvoker.<wbr>invokeOnTargetObject(<wbr>ResourceLocatorInvoker.java:<wbr>138)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceLocatorInvoker.invoke(<wbr>ResourceLocatorInvoker.java:<wbr>107)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceLocatorInvoker.<wbr>invokeOnTargetObject(<wbr>ResourceLocatorInvoker.java:<wbr>133)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>ResourceLocatorInvoker.invoke(<wbr>ResourceLocatorInvoker.java:<wbr>101)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>SynchronousDispatcher.invoke(<wbr>SynchronousDispatcher.java:<wbr>395)</div>
            <div>    at
org.jboss.resteasy.core.<wbr>SynchronousDispatcher.invoke(<wbr>SynchronousDispatcher.java:<wbr>202)</div>
            <div>    at
org.jboss.resteasy.plugins.<wbr>server.servlet.<wbr>ServletContainerDispatcher.<wbr>service(<wbr>ServletContainerDispatcher.<wbr>java:221)</div>
            <div>    at
org.jboss.resteasy.plugins.<wbr>server.servlet.<wbr>HttpServletDispatcher.service(<wbr>HttpServletDispatcher.java:56)</div>
            <div>    at
org.jboss.resteasy.plugins.<wbr>server.servlet.<wbr>HttpServletDispatcher.service(<wbr>HttpServletDispatcher.java:51)</div>
            <div>    at
              javax.servlet.http.<wbr>HttpServlet.service(<wbr>HttpServlet.java:790)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletHandler.handleRequest(<wbr>ServletHandler.java:85)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>FilterHandler$FilterChainImpl.<wbr>doFilter(FilterHandler.java:<wbr>129)</div>
            <div>    at
org.keycloak.services.filters.<wbr>KeycloakSessionServletFilter.<wbr>doFilter(<wbr>KeycloakSessionServletFilter.<wbr>java:90)</div>
            <div>    at
              io.undertow.servlet.core.<wbr>ManagedFilter.doFilter(<wbr>ManagedFilter.java:60)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>FilterHandler$FilterChainImpl.<wbr>doFilter(FilterHandler.java:<wbr>131)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>FilterHandler.handleRequest(<wbr>FilterHandler.java:84)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>security.<wbr>ServletSecurityRoleHandler.<wbr>handleRequest(<wbr>ServletSecurityRoleHandler.<wbr>java:62)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletDispatchingHandler.<wbr>handleRequest(<wbr>ServletDispatchingHandler.<wbr>java:36)</div>
            <div>    at
org.wildfly.extension.<wbr>undertow.security.<wbr>SecurityContextAssociationHand<wbr>ler.handleRequest(<wbr>SecurityContextAssociationHand<wbr>ler.java:78)</div>
            <div>    at
io.undertow.server.handlers.<wbr>PredicateHandler.<wbr>handleRequest(<wbr>PredicateHandler.java:43)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>security.<wbr>SSLInformationAssociationHandl<wbr>er.handleRequest(<wbr>SSLInformationAssociationHandl<wbr>er.java:131)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>security.<wbr>ServletAuthenticationCallHandl<wbr>er.handleRequest(<wbr>ServletAuthenticationCallHandl<wbr>er.java:57)</div>
            <div>    at
io.undertow.server.handlers.<wbr>PredicateHandler.<wbr>handleRequest(<wbr>PredicateHandler.java:43)</div>
            <div>    at
io.undertow.security.handlers.<wbr>AbstractConfidentialityHandler<wbr>.handleRequest(<wbr>AbstractConfidentialityHandler<wbr>.java:46)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>security.<wbr>ServletConfidentialityConstrai<wbr>ntHandler.handleRequest(<wbr>ServletConfidentialityConstrai<wbr>ntHandler.java:64)</div>
            <div>    at
io.undertow.security.handlers.<wbr>AuthenticationMechanismsHandle<wbr>r.handleRequest(<wbr>AuthenticationMechanismsHandle<wbr>r.java:60)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>security.<wbr>CachedAuthenticatedSessionHand<wbr>ler.handleRequest(<wbr>CachedAuthenticatedSessionHand<wbr>ler.java:77)</div>
            <div>    at
io.undertow.security.handlers.<wbr>NotificationReceiverHandler.<wbr>handleRequest(<wbr>NotificationReceiverHandler.<wbr>java:50)</div>
            <div>    at
io.undertow.security.handlers.<wbr>AbstractSecurityContextAssocia<wbr>tionHandler.handleRequest(<wbr>AbstractSecurityContextAssocia<wbr>tionHandler.java:43)</div>
            <div>    at
io.undertow.server.handlers.<wbr>PredicateHandler.<wbr>handleRequest(<wbr>PredicateHandler.java:43)</div>
            <div>    at
org.wildfly.extension.<wbr>undertow.security.jacc.<wbr>JACCContextIdHandler.<wbr>handleRequest(<wbr>JACCContextIdHandler.java:61)</div>
            <div>    at
io.undertow.server.handlers.<wbr>PredicateHandler.<wbr>handleRequest(<wbr>PredicateHandler.java:43)</div>
            <div>    at
io.undertow.server.handlers.<wbr>PredicateHandler.<wbr>handleRequest(<wbr>PredicateHandler.java:43)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletInitialHandler.<wbr>handleFirstRequest(<wbr>ServletInitialHandler.java:<wbr>284)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletInitialHandler.<wbr>dispatchRequest(<wbr>ServletInitialHandler.java:<wbr>263)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletInitialHandler.access$<wbr>000(ServletInitialHandler.<wbr>java:81)</div>
            <div>    at
io.undertow.servlet.handlers.<wbr>ServletInitialHandler$1.<wbr>handleRequest(<wbr>ServletInitialHandler.java:<wbr>174)</div>
            <div>    at
              io.undertow.server.Connectors.<wbr>executeRootHandler(Connectors.<wbr>java:202)</div>
            <div>    at
              io.undertow.server.<wbr>HttpServerExchange$1.run(<wbr>HttpServerExchange.java:793)</div>
            <div>    at
java.util.concurrent.<wbr>ThreadPoolExecutor.runWorker(<wbr>ThreadPoolExecutor.java:1142)</div>
            <div>    at
java.util.concurrent.<wbr>ThreadPoolExecutor$Worker.run(<wbr>ThreadPoolExecutor.java:617)</div>
            <div>    at java.lang.Thread.run(Thread.<wbr>java:745)</div>
            <div>Caused by: java.io.IOException: Server returned HTTP
              response code: 403 for URL: <a href="https://www.googleapis.com/plus/v1/people/me/openIdConnect" target="_blank">https://www.googleapis.com/<wbr>plus/v1/people/me/<wbr>openIdConnect</a></div>
            <div>    at
              sun.reflect.<wbr>NativeConstructorAccessorImpl.<wbr>newInstance0(Native
              Method)</div>
            <div>    at
sun.reflect.<wbr>NativeConstructorAccessorImpl.<wbr>newInstance(<wbr>NativeConstructorAccessorImpl.<wbr>java:62)</div>
            <div>    at
sun.reflect.<wbr>DelegatingConstructorAccessorI<wbr>mpl.newInstance(<wbr>DelegatingConstructorAccessorI<wbr>mpl.java:45)</div>
            <div>    at
              java.lang.reflect.Constructor.<wbr>newInstance(Constructor.java:<wbr>423)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection$10.run(<wbr>HttpURLConnection.java:1890)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection$10.run(<wbr>HttpURLConnection.java:1885)</div>
            <div>    at
              java.security.<wbr>AccessController.doPrivileged(<wbr>Native Method)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getChainedException(<wbr>HttpURLConnection.java:1884)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getInputStream0(<wbr>HttpURLConnection.java:1457)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getInputStream(<wbr>HttpURLConnection.java:1441)</div>
            <div>    at
sun.net.www.protocol.https.<wbr>HttpsURLConnectionImpl.<wbr>getInputStream(<wbr>HttpsURLConnectionImpl.java:<wbr>254)</div>
            <div>    at
org.keycloak.broker.provider.<wbr>util.SimpleHttp.asString(<wbr>SimpleHttp.java:148)</div>
            <div>    at
org.keycloak.broker.oidc.util.<wbr>JsonSimpleHttp.asJson(<wbr>JsonSimpleHttp.java:46)</div>
            <div>    at
org.keycloak.broker.oidc.<wbr>OIDCIdentityProvider.<wbr>getFederatedIdentity(<wbr>OIDCIdentityProvider.java:267)</div>
            <div>    ... 50 more</div>
            <div>Caused by: java.io.IOException: Server returned HTTP
              response code: 403 for URL: <a href="https://www.googleapis.com/plus/v1/people/me/openIdConnect" target="_blank">https://www.googleapis.com/<wbr>plus/v1/people/me/<wbr>openIdConnect</a></div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getInputStream0(<wbr>HttpURLConnection.java:1840)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getInputStream(<wbr>HttpURLConnection.java:1441)</div>
            <div>    at
sun.net.www.protocol.http.<wbr>HttpURLConnection.<wbr>getHeaderField(<wbr>HttpURLConnection.java:2943)</div>
            <div>    at
sun.net.www.protocol.https.<wbr>HttpsURLConnectionImpl.<wbr>getHeaderField(<wbr>HttpsURLConnectionImpl.java:<wbr>291)</div>
            <div>    at
org.keycloak.broker.provider.<wbr>util.SimpleHttp.asString(<wbr>SimpleHttp.java:147)</div>
            <div>    ... 52 more</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><div><br></div>
</div></div>