<div dir="ltr">I am wondering how you do that. I know that there is a state parameter that is added to the facebook login url, but I could just make an initial request to keycloak to copy that, or did I understand something wrong?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-03 9:22 GMT+01:00 Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:stian@redhat.com" target="_blank">stian@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It&#39;s code that is currently changing as we&#39;re working on adding enterprise IdP&#39;s as well as social IdP&#39;s we have at the moment.<br>
<br>
I think the correct approach would be to use the direct grant api, which currently lets you exchange a username + password for a Keycloak token, we could add an option here to pass in a token from an external IdP to exchange for a internal Keycloak token. If you&#39;re interested in looking at the code look at OpenIDConnectService.grantAccessToken.<br>
<br>
There&#39;s no work-around that you can do due to security restrictions in Keycloak. Keycloak makes sure that the callback can only be called if it indeed made the original request.<br>
<span class=""><br>
----- Original Message -----<br>
&gt; From: &quot;Christian Beikov&quot; &lt;<a href="mailto:christian.beikov@gmail.com">christian.beikov@gmail.com</a>&gt;<br>
</span><div><div class="h5">&gt; To: &quot;Stian Thorgersen&quot; &lt;<a href="mailto:stian@redhat.com">stian@redhat.com</a>&gt;<br>
&gt; Sent: Wednesday, 3 December, 2014 9:11:55 AM<br>
&gt; Subject: Re: [keycloak-dev] Login with Access Token<br>
&gt;<br>
&gt; Thanks for the quick answer. Could you maybe give me a hint on how I could<br>
&gt; implement that in a quick-and-dirty way? Could I maybe do some iframe magic<br>
&gt; in a hidden webview to do the login? I am not quite sure how the social<br>
&gt; login works exactly. Facebook will redirect me back to the social callback<br>
&gt; address after a login, but how does keycloak actually retrieve that access<br>
&gt; token? If I knew that, I could maybe create a workaround for now and maybe<br>
&gt; also contribute something? :)<br>
&gt;<br>
&gt; 2014-12-03 8:48 GMT+01:00 Stian Thorgersen &lt;<a href="mailto:stian@redhat.com">stian@redhat.com</a>&gt;:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ----- Original Message -----<br>
&gt; &gt; &gt; From: &quot;Christian Beikov&quot; &lt;<a href="mailto:christian.beikov@gmail.com">christian.beikov@gmail.com</a>&gt;<br>
&gt; &gt; &gt; To: <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; &gt; &gt; Sent: Tuesday, 2 December, 2014 6:58:42 PM<br>
&gt; &gt; &gt; Subject: [keycloak-dev] Login with Access Token<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Hello!<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I am new to OAuth so sorry if my question is dumb.<br>
&gt; &gt; &gt; I have an App which wants to provide a custom and Facebook login. Since<br>
&gt; &gt; many<br>
&gt; &gt; &gt; people already have the Facebook App installed, I thought it might be<br>
&gt; &gt; better<br>
&gt; &gt; &gt; to give them the native experience and use the Facebook SDK to implement<br>
&gt; &gt; the<br>
&gt; &gt; &gt; login.<br>
&gt; &gt; &gt; The problem now is, that I have the Access Token from the successful<br>
&gt; &gt; Facebook<br>
&gt; &gt; &gt; login, but don&#39;t know how to properly login at the Keycloak server with<br>
&gt; &gt; &gt; that.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any ideas on how to do that? Or is that even stupid and is there a better<br>
&gt; &gt; &gt; way?<br>
&gt; &gt;<br>
&gt; &gt; Not at all a dumb question and we actually had someone else ask the same<br>
&gt; &gt; last week.<br>
&gt; &gt;<br>
&gt; &gt; Currently, Keycloak does not support this flow, but it something we may<br>
&gt; &gt; consider adding.<br>
&gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Mit freundlichen Grüßen,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Christian Beikov<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; keycloak-dev mailing list<br>
&gt; &gt; &gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; Mit freundlichen Grüßen,<br>
&gt;<br>
&gt;<br>
</div></div>&gt; *Christian Beikov*Blazebit Design &amp; Developing<br>
&gt; <a href="http://www.blazebit.com" target="_blank">http://www.blazebit.com</a><br>
&gt;<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><br>Mit freundlichen Grüßen,<br><br><b>Christian Beikov<br></b>Blazebit Design &amp; Developing<br><a href="http://www.blazebit.com" target="_blank">http://www.blazebit.com</a></div></div>
</div>