{"action":"created","issue":{"url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/102","repository_url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js","labels_url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/102/comments","events_url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/102/events","html_url":"https://github.com/spring-guides/tut-spring-security-and-angular-js/issues/102","id":156344336,"number":102,"title":"Not able to get access token!","user":{"login":"cvenegasj","id":4387876,"avatar_url":"https://avatars.githubusercontent.com/u/4387876?v=3","gravatar_id":"","url":"https://api.github.com/users/cvenegasj","html_url":"https://github.com/cvenegasj","followers_url":"https://api.github.com/users/cvenegasj/followers","following_url":"https://api.github.com/users/cvenegasj/following{/other_user}","gists_url":"https://api.github.com/users/cvenegasj/gists{/gist_id}","starred_url":"https://api.github.com/users/cvenegasj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvenegasj/subscriptions","organizations_url":"https://api.github.com/users/cvenegasj/orgs","repos_url":"https://api.github.com/users/cvenegasj/repos","events_url":"https://api.github.com/users/cvenegasj/events{/privacy}","received_events_url":"https://api.github.com/users/cvenegasj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-23T19:09:47Z","updated_at":"2016-05-24T21:06:17Z","closed_at":null,"body":"Hi. I am using the 'oauth2-vanilla' architecture from this tutorial series for my web application. Since I am using the OAuth2 authentication API from a third-party server I just have UI server and Resource Server. \r\nI registered my app in the third-party server for getting the clientId and clientSecret. \r\n\r\nFor some reason this server does not send me the access token and Spring Security shows this whitelabel error page:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4387876/15480728/b2666366-20ec-11e6-86a3-578af8ddbdc5.png)\r\n\r\nThis is a part of the stack trace that Spring throws:\r\n![image](https://cloud.githubusercontent.com/assets/4387876/15480886/6a5eaad2-20ed-11e6-977c-e37f48b9fb64.png)\r\n\r\nThis is the security config for my UI server:\r\n`security:\r\n  oauth2:\r\n    client:\r\n      clientId: 233eb71722c2eb18e79d3fc5e00bd20a8bbbeb89049d2d17bc30d76e9f1f7fb9\r\n      clientSecret: f0598c6da0843abd113c3d51eb6325dbfcb67aa4a13f7f7d328e040263527d11\r\n      accessTokenUri: https://api.fablabs.io/oauth/token\r\n      userAuthorizationUri: https://api.fablabs.io/oauth/authorize\r\n      clientAuthenticationScheme: form\r\n    resource:\r\n      userInfoUri: https://api.fablabs.io/v0/me`\r\n\r\nNot sure what is going wrong with the authentication process. The third-party auth server is implemented with Ruby on Rails and Doorkeeper gem. If you check the whitelabel error page, the authorization code shown after I successfully sign in using the login form from the OAuth2 provider, is on the url but my app cannot exchange it for the access token. \r\n\r\nI have tested sending the POST request using postman extension and the access token is SUCCESSFULLY returned: \r\n![image](https://cloud.githubusercontent.com/assets/4387876/15481374/b79577fc-20ef-11e6-9462-e41c51024140.png)\r\n\r\n\r\nOn the other hand, I have been able to successfully login using the GitHub API and the Google OpenID connect also. So, I don't know what is going wrong here..\r\n\r\nCould be that I am not using an https protocol for testing in localhost? the csrfHeaderFilter?...\r\n\r\nThis is the API I am using: [https://github.com/fablabbcn/fablabs-api-examples](url)\r\nI would appreciate some help on this issue. Thanks!"},"comment":{"url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/comments/221401214","html_url":"https://github.com/spring-guides/tut-spring-security-and-angular-js/issues/102#issuecomment-221401214","issue_url":"https://api.github.com/repos/spring-guides/tut-spring-security-and-angular-js/issues/102","id":221401214,"user":{"login":"dsyer","id":124075,"avatar_url":"https://avatars.githubusercontent.com/u/124075?v=3","gravatar_id":"","url":"https://api.github.com/users/dsyer","html_url":"https://github.com/dsyer","followers_url":"https://api.github.com/users/dsyer/followers","following_url":"https://api.github.com/users/dsyer/following{/other_user}","gists_url":"https://api.github.com/users/dsyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyer/subscriptions","organizations_url":"https://api.github.com/users/dsyer/orgs","repos_url":"https://api.github.com/users/dsyer/repos","events_url":"https://api.github.com/users/dsyer/events{/privacy}","received_events_url":"https://api.github.com/users/dsyer/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T21:06:17Z","updated_at":"2016-05-24T21:06:17Z","body":"If the provider isn't giving you better documentation, you might have to reverse engineer a client that you know is working. I assume the client you linked to above (in node) works. Follow the back channel with a TCP sniffer or something and find out what it is sending."}}
{"actor":{"display_login":"dsyer"}}