{"action":"opened","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/1185","labels_url":"https://api.github.com/repos/gocd/gocd/issues/1185/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1185/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/1185/events","html_url":"https://github.com/gocd/gocd/issues/1185","id":85022340,"number":1185,"title":"Accessing login url for auth endpoint for the first time throws a 404 page ","user":{"login":"jyotisingh","id":1046342,"avatar_url":"https://avatars.githubusercontent.com/u/1046342?v=3","gravatar_id":"","url":"https://api.github.com/users/jyotisingh","html_url":"https://github.com/jyotisingh","followers_url":"https://api.github.com/users/jyotisingh/followers","following_url":"https://api.github.com/users/jyotisingh/following{/other_user}","gists_url":"https://api.github.com/users/jyotisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/jyotisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyotisingh/subscriptions","organizations_url":"https://api.github.com/users/jyotisingh/orgs","repos_url":"https://api.github.com/users/jyotisingh/repos","events_url":"https://api.github.com/users/jyotisingh/events{/privacy}","received_events_url":"https://api.github.com/users/jyotisingh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-04T10:12:22Z","updated_at":"2015-06-04T10:12:22Z","closed_at":null,"body":"Steps:\r\n1. Install and configure github-oauth plugin in Go\r\n2. open a browser, clear all cache and cookies.\r\n3. Access the login url -> localhost:8153/go/plugin/interact/github.oauth.login/index\r\n\r\nIt should redirect to github login page, but it throws a 404 page from github instead. If you hit the url again from browser, it starts working as expected. \r\n\r\nFindings:\r\nBasically, first time around jsessionid gets attached to the url causing github to throw a 404, eg: \r\n```url\r\nhttps://github.com/login/oauth/authorize;jsessionid=px4zl3mmyjrx1toq7bw5e2v0d?client_id=6c4ce62f2e0d2fb1dde1&response_type=code&redirect_uri=https%3A%2F%2Flocalhost%3A8154%2Fgo%2Fplugin%2Finteract%2Fgithub.oauth.login%2Fauthenticate&scope=user,user:email\r\n```\r\n\r\nOn second attempt, jessionid is not a part of the url and hence github responds with the authentication page as expected.\r\n"}}