{"action":"created","issue":{"url":"https://api.github.com/repos/p2/OAuth2/issues/66","labels_url":"https://api.github.com/repos/p2/OAuth2/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/p2/OAuth2/issues/66/comments","events_url":"https://api.github.com/repos/p2/OAuth2/issues/66/events","html_url":"https://github.com/p2/OAuth2/issues/66","id":117736968,"number":66,"title":"How to use a client side form to pass credentials with p2","user":{"login":"noctivityinc","id":78850,"avatar_url":"https://avatars.githubusercontent.com/u/78850?v=3","gravatar_id":"","url":"https://api.github.com/users/noctivityinc","html_url":"https://github.com/noctivityinc","followers_url":"https://api.github.com/users/noctivityinc/followers","following_url":"https://api.github.com/users/noctivityinc/following{/other_user}","gists_url":"https://api.github.com/users/noctivityinc/gists{/gist_id}","starred_url":"https://api.github.com/users/noctivityinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noctivityinc/subscriptions","organizations_url":"https://api.github.com/users/noctivityinc/orgs","repos_url":"https://api.github.com/users/noctivityinc/repos","events_url":"https://api.github.com/users/noctivityinc/events{/privacy}","received_events_url":"https://api.github.com/users/noctivityinc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-19T04:04:52Z","updated_at":"2015-11-19T16:18:04Z","closed_at":"2015-11-19T16:18:04Z","body":"I believe it's possible to have a form in the app that asks for the username and password and authenticate it against the OAuth2 app, which I am hoping will solve my login/logout issues, but I cant seem to find any example or detailed code on how we would do this with p2.  Is it possible and, if so, where can we find info on how to proceed?\r\n\r\nAlso, when you are using p2 to make requests how are you checking with each request if the current access token is still valid?   For example, if an API returns a 401 due to the passed access token being forbidden, how are you detecting this with P2?  Right now, no errors or the like are thrown."},"comment":{"url":"https://api.github.com/repos/p2/OAuth2/issues/comments/158105502","html_url":"https://github.com/p2/OAuth2/issues/66#issuecomment-158105502","issue_url":"https://api.github.com/repos/p2/OAuth2/issues/66","id":158105502,"user":{"login":"p2","id":358485,"avatar_url":"https://avatars.githubusercontent.com/u/358485?v=3","gravatar_id":"","url":"https://api.github.com/users/p2","html_url":"https://github.com/p2","followers_url":"https://api.github.com/users/p2/followers","following_url":"https://api.github.com/users/p2/following{/other_user}","gists_url":"https://api.github.com/users/p2/gists{/gist_id}","starred_url":"https://api.github.com/users/p2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p2/subscriptions","organizations_url":"https://api.github.com/users/p2/orgs","repos_url":"https://api.github.com/users/p2/repos","events_url":"https://api.github.com/users/p2/events{/privacy}","received_events_url":"https://api.github.com/users/p2/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T16:18:04Z","updated_at":"2015-11-19T16:18:04Z","body":"Yes, you can use the `OAuth2PasswordGrant` to use username and password directly.\r\n\r\nYou have to check for 401s yourself and take appropriate action, [see here](https://github.com/p2/OAuth2#6-re-authorize)."}}