{"action":"created","issue":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/367","labels_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/367/comments","events_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/367/events","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/367","id":104241747,"number":367,"title":"getting ng-token-auth and devise_token_auth to work with OAuth in ionic InAppBrowser","user":{"login":"abhayastudios","id":1121217,"avatar_url":"https://avatars.githubusercontent.com/u/1121217?v=3","gravatar_id":"","url":"https://api.github.com/users/abhayastudios","html_url":"https://github.com/abhayastudios","followers_url":"https://api.github.com/users/abhayastudios/followers","following_url":"https://api.github.com/users/abhayastudios/following{/other_user}","gists_url":"https://api.github.com/users/abhayastudios/gists{/gist_id}","starred_url":"https://api.github.com/users/abhayastudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhayastudios/subscriptions","organizations_url":"https://api.github.com/users/abhayastudios/orgs","repos_url":"https://api.github.com/users/abhayastudios/repos","events_url":"https://api.github.com/users/abhayastudios/events{/privacy}","received_events_url":"https://api.github.com/users/abhayastudios/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-01T11:03:44Z","updated_at":"2015-09-06T17:00:14Z","closed_at":"2015-09-06T17:00:14Z","body":"When I test the setup on my laptop Chrome browser everything works just fine using both sameWindow and newWindow: I am able to login though for example Facebook and the user is authorized and can use my app.\r\n\r\nHowever, when I try to deploy the app to android and use the inAppBrowser things break. When selecting the 'login through FB' button in my app I can see the inAppBrowser frame come up with the Facebook mobile site asking to login. When I inspect that specific window through Chrome inspect, I can see that the callback from FB coming in to omniauth on my server including state and code in the querystring:\r\n\r\n    https://<app>.herokuapp.com/omniauth/facebook/callback?code=<code>&state=<state>\r\n\r\nThis request receives a 302 redirect to the following URL:\r\n\r\n    https://<app>.herokuapp.com/api/v1/auth/facebook/callback\r\n\r\nThis follow-up request receives a 200 response, the inAppBrowser window closes, we get back to my ionic app and I see the ng-token-auth \"auth:login-success\" event passing by.\r\n\r\nHowever, any subsequent API requests to my server receive a 401 Not Authorized response. When I look at the request headers of those API requests I don't see any of the headers that Chrome on my laptop is sending to the server such as: access-token, client, expiry, token-type and uid.\r\n\r\nAs far as I understand from the limited documentation the combo of devise_token_auth and ng-token-auth should work out of the box right? Does that mean that the window.eventlistener and  postMessage handling that are mentioned in the docs are covered? In any case I don't see any passing of tokens between the two. Also the links in the docs to the example controller, layout and view don't work so I was wondering whether someone could explain give me a hint on where to look.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/comments/138100301","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/367#issuecomment-138100301","issue_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/367","id":138100301,"user":{"login":"abhayastudios","id":1121217,"avatar_url":"https://avatars.githubusercontent.com/u/1121217?v=3","gravatar_id":"","url":"https://api.github.com/users/abhayastudios","html_url":"https://github.com/abhayastudios","followers_url":"https://api.github.com/users/abhayastudios/followers","following_url":"https://api.github.com/users/abhayastudios/following{/other_user}","gists_url":"https://api.github.com/users/abhayastudios/gists{/gist_id}","starred_url":"https://api.github.com/users/abhayastudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhayastudios/subscriptions","organizations_url":"https://api.github.com/users/abhayastudios/orgs","repos_url":"https://api.github.com/users/abhayastudios/repos","events_url":"https://api.github.com/users/abhayastudios/events{/privacy}","received_events_url":"https://api.github.com/users/abhayastudios/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T17:00:14Z","updated_at":"2015-09-06T17:00:14Z","body":"Closing as it seems an issue with ng-token-auth. Opening an issue there."}}