{"action":"created","issue":{"url":"https://api.github.com/repos/gravitational/teleport/issues/408","repository_url":"https://api.github.com/repos/gravitational/teleport","labels_url":"https://api.github.com/repos/gravitational/teleport/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/gravitational/teleport/issues/408/comments","events_url":"https://api.github.com/repos/gravitational/teleport/issues/408/events","html_url":"https://github.com/gravitational/teleport/issues/408","id":153915451,"number":408,"title":"UX: `tsh --auth` fails to understand user","user":{"login":"klizhentas","id":13717,"avatar_url":"https://avatars.githubusercontent.com/u/13717?v=3","gravatar_id":"","url":"https://api.github.com/users/klizhentas","html_url":"https://github.com/klizhentas","followers_url":"https://api.github.com/users/klizhentas/followers","following_url":"https://api.github.com/users/klizhentas/following{/other_user}","gists_url":"https://api.github.com/users/klizhentas/gists{/gist_id}","starred_url":"https://api.github.com/users/klizhentas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klizhentas/subscriptions","organizations_url":"https://api.github.com/users/klizhentas/orgs","repos_url":"https://api.github.com/users/klizhentas/repos","events_url":"https://api.github.com/users/klizhentas/events{/privacy}","received_events_url":"https://api.github.com/users/klizhentas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gravitational/teleport/labels/enhancement","name":"enhancement","color":"c7def8"},{"url":"https://api.github.com/repos/gravitational/teleport/labels/P1","name":"P1","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"kontsevoy","id":461020,"avatar_url":"https://avatars.githubusercontent.com/u/461020?v=3","gravatar_id":"","url":"https://api.github.com/users/kontsevoy","html_url":"https://github.com/kontsevoy","followers_url":"https://api.github.com/users/kontsevoy/followers","following_url":"https://api.github.com/users/kontsevoy/following{/other_user}","gists_url":"https://api.github.com/users/kontsevoy/gists{/gist_id}","starred_url":"https://api.github.com/users/kontsevoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontsevoy/subscriptions","organizations_url":"https://api.github.com/users/kontsevoy/orgs","repos_url":"https://api.github.com/users/kontsevoy/repos","events_url":"https://api.github.com/users/kontsevoy/events{/privacy}","received_events_url":"https://api.github.com/users/kontsevoy/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-10T03:14:32Z","updated_at":"2016-05-10T03:16:04Z","closed_at":null,"body":"here's what started to happen when I use OIDC with tsh. \r\n\r\n* Login is successful. \r\n* Next time I execute the same command it fails to find existing keys:\r\n\r\n\r\n```\r\nexport TELEPORT_LOGIN=admin; export TELEPORT_PROXY=localhost; export TELEPORT_AUTH=google; export TELEPORT_SITE=example.com; tsh -d ssh --local -L 8080:localhost:8080 -L 5000:localhost:5000 root@teleport-role=master\r\n\r\nINFO[0000] no teleport login given. defaulting to sasha  file=client/api.go:174\r\nINFO[0000] using FSLocalKeyStore                         file=client/keystore.go:71\r\nERRO[0000] open /home/sasha/.tsh/keys/localhost/sasha.cert: no such file or directory  file=client/keystore.go:147\r\nINFO[0000] Got error after GetKey(sasha): open /home/sasha/.tsh/keys/localhost/sasha.cert: no such file or directory  file=client/keystore.go:97\r\nERRO[0000] open /home/sasha/.tsh/keys/localhost/sasha.cert: no such file or directory  file=client/keystore.go:147\r\nINFO[0000] Got error after GetKey(sasha): open /home/sasha/.tsh/keys/localhost/sasha.cert: no such file or directory  file=client/keystore.go:97\r\nINFO[0000] connecting to proxy: localhost:3023 with host login root  file=client/api.go:772\r\n```\r\n\r\nThis happens because I authenitcate not as `sasha` but as `admin`. Here's my keys dir:\r\n\r\n```\r\nls -l ~/.tsh/keys/localhost/\r\ntotal 12\r\n-rw-r----- 1 sasha sasha 1354 May  9 20:05 admin.cert\r\n-rw-r----- 1 sasha sasha 1679 May  9 20:05 admin.key\r\n-rw-r----- 1 sasha sasha  381 May  9 20:05 admin.pub\r\n```\r\n\r\nSo it fails to recognize that I've logged in already and let me in. \r\n\r\nHowever I was able to solve this issue without any coding, by simply hinting `tsh` what user I need by adding `--user` flag:\r\n\r\nexport TELEPORT_LOGIN=admin; export TELEPORT_PROXY=localhost; export TELEPORT_AUTH=google; export TELEPORT_SITE=example.com; tsh ssh --user=admin --local -L 8080:localhost:8080 -L 5000:localhost:5000 root@teleport-role=master\r\n\r\nSo I'm thinking this not a bug, but a UX issue"},"comment":{"url":"https://api.github.com/repos/gravitational/teleport/issues/comments/218048887","html_url":"https://github.com/gravitational/teleport/issues/408#issuecomment-218048887","issue_url":"https://api.github.com/repos/gravitational/teleport/issues/408","id":218048887,"user":{"login":"klizhentas","id":13717,"avatar_url":"https://avatars.githubusercontent.com/u/13717?v=3","gravatar_id":"","url":"https://api.github.com/users/klizhentas","html_url":"https://github.com/klizhentas","followers_url":"https://api.github.com/users/klizhentas/followers","following_url":"https://api.github.com/users/klizhentas/following{/other_user}","gists_url":"https://api.github.com/users/klizhentas/gists{/gist_id}","starred_url":"https://api.github.com/users/klizhentas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klizhentas/subscriptions","organizations_url":"https://api.github.com/users/klizhentas/orgs","repos_url":"https://api.github.com/users/klizhentas/repos","events_url":"https://api.github.com/users/klizhentas/events{/privacy}","received_events_url":"https://api.github.com/users/klizhentas/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T03:16:04Z","updated_at":"2016-05-10T03:16:04Z","body":"I think your suggestion to use:\r\n\r\n```\r\n--user=admin/google\r\n```\r\nwill actually work"}}