<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The way that the authorization code flow in OAuth works, you need to send the user in a web browser to the authorization page. It’s not something you fetch directly. What you’re seeing below is the server requiring the user to log in, which is to be expected since you’re just sending things with curl.<div class=""><br class=""></div><div class="">I suggest reading through some intro material on OAuth to get a better idea of how things are supposed to work. These slides from from a class I taught last year and you may find them helpful:</div><div class=""><br class=""></div><div class=""><a href="http://www.slideshare.net/zeronine1/mit-2014-introduction-to-open-id-connect-and-oauth-2" class="">http://www.slideshare.net/zeronine1/mit-2014-introduction-to-open-id-connect-and-oauth-2</a></div><div class=""><br class=""></div><div class="">&nbsp;— Justin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 31, 2015, at 12:23 PM, Sergiy Lystopad &lt;<a href="mailto:slystopad@mirantis.com" class="">slystopad@mirantis.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class=""><div class=""><div class=""><div class="">Hi, colleagues.<br class=""><br class=""></div>I am trying to check Authorization Code Flow.<br class=""></div>I have registered new RP(client) via Administrative UI (specifyed client ID, <span class="">Redirect URI, checked</span><span class=""> Grant Types: </span><span class="">authorization code and </span><span class="">password. Other options - default</span>)<br class=""><br class=""></div><div class="">Then I have tried to get Access Token with curl:<br class=""></div><div class="">curl -i -X GET '<a href="http://192.168.0.123:8080/openid-connect-server-webapp/authorize?response_type=code&amp;scope=openid%20profile%20email&amp;client_id=curlClient2&amp;state=state12345&amp;redirect_uri=http://192.168.192.168/redirect" class="">http://192.168.0.123:8080/openid-connect-server-webapp/authorize?response_type=code&amp;scope=openid%20profile%20email&amp;client_id=curlClient2&amp;state=state12345&amp;redirect_uri=http://192.168.192.168/redirect</a>'<br class=""><br class=""></div><div class="">I expect something like:<br class="">HTTP/1.1 302 Found<br class="">&nbsp;Location: <a href="https://server.example.com/oidcclient/redirect/client01" class="">https://server.example.com:443/oidcclient/redirect/client01</a><br class="">&nbsp; &nbsp; &nbsp;code=SplxlOBeZQQYbYS6WxSbIA<br class="">&nbsp; &nbsp; &nbsp;&amp;state=state12345<br class=""><br class=""></div><div class="">but got:<br class="">HTTP/1.1 302 Found<br class="">Server: Apache-Coyote/1.1<br class="">Set-Cookie: JSESSIONID=896E596E8B00E7B3FC9AF08337739C02; Path=/openid-connect-server-webapp/; HttpOnly<br class="">X-Frame-Options: DENY<br class="">Location: <a href="http://192.168.0.123:8080/openid-connect-server-webapp/login" class="">http://192.168.0.123:8080/openid-connect-server-webapp/login</a><br class="">Content-Length: 0<br class="">Date: Mon, 31 Aug 2015 16:15:19 GMT<br class=""><br class=""></div><div class="">What I am doing wrong?<br class=""><br class=""></div><div class="">P.S. Sorry for dumb questions, but I think here is best place where I could found answers.<br class=""></div><div class=""><br class="">Thank you in advance.<br class=""></div><div class=""></div><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">-- <br class=""><div class="gmail_signature"><div dir="ltr" class="">Sergiy Lystopad<br class=""></div></div>
</div></div></div></div></div></div></div>
_______________________________________________<br class="">mitreid-connect mailing list<br class=""><a href="mailto:mitreid-connect@mit.edu" class="">mitreid-connect@mit.edu</a><br class="">http://mailman.mit.edu/mailman/listinfo/mitreid-connect<br class=""></div></blockquote></div><br class=""></div></body></html>