<div dir="ltr">Basic auth should work with resource owner password credentials grant which I think is what Bill is talking about.  If it does not work, sending the user / pw as a form parameter in POST along with the other needed stuff definitely works.<div><br></div><div>from the RFC: <a href="http://tools.ietf.org/html/rfc6749#section-4.3">http://tools.ietf.org/html/rfc6749#section-4.3</a></div><div><div>   The resource owner password credentials grant type is suitable in</div><div>   cases where the resource owner has a trust relationship with the</div><div>   client, such as the device operating system or a highly privileged</div><div>   application.  The authorization server should take special care when</div><div>   enabling this grant type and only allow it when other flows are not</div><div>   viable.</div></div><div><br></div><div>The only reason you wouldn&#39;t use this is if you don&#39;t trust your application with the credentials it needs to use.  By trying to get your app to go through the auth code flow without user interaction, I&#39;m betting you are already embedding the credentials in your code.  If that is the case, I think using this is no less secure.</div><div><br></div><div>-Brian</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div style="font-size:small">Brian Cook</div><div style="font-size:small">Principal Product Manager </div><div style="font-size:small">Ecosystem and Certification tools</div><div style="font-size:small">407-212-7079</div></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 27, 2016 at 9:46 AM, Aikeaguinea <span dir="ltr">&lt;<a href="mailto:aikeaguinea@xsmail.com" target="_blank">aikeaguinea@xsmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, we could do this -- my impression though was that the auth code<br>
flow is considered more secure. (I admit I&#39;m not entirely sure how the<br>
Keycloak implicit grant flow differs from direct access grants --<br>
whenever I look at OAuth documentation it just mentions the explicit and<br>
implicit flows.)<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Apr 27, 2016, at 12:14 PM, Bill Burke wrote:<br>
&gt; Ues direct grants?<br>
&gt;<br>
&gt; On 4/27/2016 11:17 AM, Aikeaguinea wrote:<br>
&gt; &gt; As I understand it, using the authorization code flow rather than the<br>
&gt; &gt; implicit flow is recommended where possible.<br>
&gt; &gt;<br>
&gt; &gt; We have a server-side client application, but the user agents making<br>
&gt; &gt; requests are not browsers, but instead our own code.<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m not entirely sure how to make the authorization code flow work<br>
&gt; &gt; without a browser. For instance, if on the command line I request<br>
&gt; &gt;<br>
&gt; &gt; curl<br>
&gt; &gt; &#39;http://host:port/auth/realms/foo/protocol/openid-connect/auth?response_type=code&amp;client_id=test-client&amp;state=state&amp;redirect_uri=<a href="http://www.example.com/hello-world" rel="noreferrer" target="_blank">http://www.example.com/hello-world</a>&#39;<br>
&gt; &gt;<br>
&gt; &gt; Then (assuming the parameters are correct) I get back an HTML login page<br>
&gt; &gt; with a form. In order to submit the credentials, I would need to dig the<br>
&gt; &gt; URL out of the action of the form and then submit a request like<br>
&gt; &gt;<br>
&gt; &gt; curl -X POST -d &#39;username=test-user&#39; -d &#39;password=test1234&#39;<br>
&gt; &gt; &#39;http://host:port/auth/realms/foo/login-actions/authenticate?code=Ctr79aRsbwPPkC4nEeT2vR9-TuC31uuXngQXoHQH6FE.ef26cfcd-a35b-4d1e-a4f7-49790f6e2f00&amp;execution=a86f56da-9900-4f1d-a461-f18617a2333b&#39;<br>
&gt; &gt;<br>
&gt; &gt; Three questions:<br>
&gt; &gt; 1. Is there some reason I shouldn&#39;t be trying to implement the<br>
&gt; &gt; authorization code flow like this?<br>
&gt; &gt;<br>
&gt; &gt; 2. Is there a way to get the proper login action back without having to<br>
&gt; &gt; dig it out of an HTML form? I&#39;ve tried adding --header &quot;Accept:<br>
&gt; &gt; application/json&quot; to the command but this has no effect.<br>
&gt; &gt;<br>
&gt; &gt; 3. Is there a way of submitting credentials other than by using form<br>
&gt; &gt; parameters? I&#39;ve tried HTTP basic auth but it doesn&#39;t work for me.<br>
&gt; &gt;<br>
&gt;<br>
&gt; --<br>
&gt; Bill Burke<br>
&gt; JBoss, a division of Red Hat<br>
&gt; <a href="http://bill.burkecentral.com" rel="noreferrer" target="_blank">http://bill.burkecentral.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; keycloak-user mailing list<br>
&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
  Aikeaguinea<br>
  <a href="mailto:aikeaguinea@xsmail.com">aikeaguinea@xsmail.com</a><br>
<br>
--<br>
<a href="http://www.fastmail.com" rel="noreferrer" target="_blank">http://www.fastmail.com</a> - Access all of your messages and folders<br>
                          wherever you are<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</div></div></blockquote></div><br></div>