{"action":"created","issue":{"url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/115","labels_url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/115/comments","events_url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/115/events","html_url":"https://github.com/angularjs-oauth/oauth-ng/issues/115","id":128782617,"number":115,"title":"How to setup Authorization Code Flow","user":{"login":"NickAb","id":866739,"avatar_url":"https://avatars.githubusercontent.com/u/866739?v=3","gravatar_id":"","url":"https://api.github.com/users/NickAb","html_url":"https://github.com/NickAb","followers_url":"https://api.github.com/users/NickAb/followers","following_url":"https://api.github.com/users/NickAb/following{/other_user}","gists_url":"https://api.github.com/users/NickAb/gists{/gist_id}","starred_url":"https://api.github.com/users/NickAb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickAb/subscriptions","organizations_url":"https://api.github.com/users/NickAb/orgs","repos_url":"https://api.github.com/users/NickAb/repos","events_url":"https://api.github.com/users/NickAb/events{/privacy}","received_events_url":"https://api.github.com/users/NickAb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-26T10:22:28Z","updated_at":"2016-01-26T17:07:18Z","closed_at":null,"body":"I need to implement Authorization Code Flow to authorize against ADFS server.\r\nI have downloaded demo https://github.com/andreareginato/oauth-ng-demo and installed latest oauth-ng.\r\n```\r\n<oauth\r\n      site=\"https://testadfs.local/adfs\"\r\n      client-id=\"CLIENT_IF\"\r\n      redirect-uri=\"http://localhost:9000\"\r\n      authorize-path=\"/oauth2/authorize\"\r\n      token-path=\"/oauth2/token\"\r\n      response-type=\"code\"\r\n>\r\n```\r\nI am getting redirect to adfs loging page where I login, after that a redirect back to redirect-uri=\"http://localhost:9000\" happens and ulr changes to\r\n```\r\nhttp://localhost:9000/?code=SOME_LONG_CODE\r\n```\r\nSo I got authorization code but no other action to exchange `code` for access token did happen. What should I do, should I add code for requesting `token` using `code`, or should it be handled automatically by oauth-ng and I have some configuration problem?"},"comment":{"url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/comments/175120293","html_url":"https://github.com/angularjs-oauth/oauth-ng/issues/115#issuecomment-175120293","issue_url":"https://api.github.com/repos/angularjs-oauth/oauth-ng/issues/115","id":175120293,"user":{"login":"faraway","id":1863592,"avatar_url":"https://avatars.githubusercontent.com/u/1863592?v=3","gravatar_id":"","url":"https://api.github.com/users/faraway","html_url":"https://github.com/faraway","followers_url":"https://api.github.com/users/faraway/followers","following_url":"https://api.github.com/users/faraway/following{/other_user}","gists_url":"https://api.github.com/users/faraway/gists{/gist_id}","starred_url":"https://api.github.com/users/faraway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faraway/subscriptions","organizations_url":"https://api.github.com/users/faraway/orgs","repos_url":"https://api.github.com/users/faraway/repos","events_url":"https://api.github.com/users/faraway/events{/privacy}","received_events_url":"https://api.github.com/users/faraway/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T17:07:18Z","updated_at":"2016-01-26T17:07:18Z","body":"@NickAb The Authorization Code Flow is also sometimes called server side flow, which means you need your backend server to do some work. In your case, your server needs to understand and process the redirect (think about `http://localhost:9000/?code=SOME_LONG_CODE` as a regular request). In fact, most of the work of Auth code flow is done by the app server and the IdP, at client agent (browser) side, it just initialize the auth request. \r\nIMO, the current oauth-ng documentation is a little confusing about this part. I will try to send a PR to refine it."}}