{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/2339","labels_url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/2339/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/2339/comments","events_url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/2339/events","html_url":"https://github.com/Azure/azure-xplat-cli/issues/2339","id":119998214,"number":2339,"title":"Azure login not persistent ","user":{"login":"AyeJeigh","id":16121906,"avatar_url":"https://avatars.githubusercontent.com/u/16121906?v=3","gravatar_id":"","url":"https://api.github.com/users/AyeJeigh","html_url":"https://github.com/AyeJeigh","followers_url":"https://api.github.com/users/AyeJeigh/followers","following_url":"https://api.github.com/users/AyeJeigh/following{/other_user}","gists_url":"https://api.github.com/users/AyeJeigh/gists{/gist_id}","starred_url":"https://api.github.com/users/AyeJeigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyeJeigh/subscriptions","organizations_url":"https://api.github.com/users/AyeJeigh/orgs","repos_url":"https://api.github.com/users/AyeJeigh/repos","events_url":"https://api.github.com/users/AyeJeigh/events{/privacy}","received_events_url":"https://api.github.com/users/AyeJeigh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-02T17:47:07Z","updated_at":"2015-12-02T18:52:18Z","closed_at":null,"body":"Hello,\r\n\r\nFor some reason, I can't get my azure-cli login to be persistent.  When I get into work in the morning, I have to manually run \"azure login\" or \"azure account import\" and it works for the rest of the day.  However, the next morning none of my commands work and I get this error:\r\n\r\n\"error:   We don't have a valid access token. Please run \"azure login\" again.\"\r\n\r\nI've tried clearing my creds like so:\r\n\r\nazure logout me@website.com\r\nazure account clear -q\r\nazure login\r\nazure account set 'Name of My Account'\r\n\r\n\r\nI'm running version 0.9.12 on Ubuntu 15.04\r\n\r\nFor the time being, I set up a cron job to import my cert every morning.  Does anyone have any ideas?"},"comment":{"url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/comments/161396618","html_url":"https://github.com/Azure/azure-xplat-cli/issues/2339#issuecomment-161396618","issue_url":"https://api.github.com/repos/Azure/azure-xplat-cli/issues/2339","id":161396618,"user":{"login":"yugangw-msft","id":6014209,"avatar_url":"https://avatars.githubusercontent.com/u/6014209?v=3","gravatar_id":"","url":"https://api.github.com/users/yugangw-msft","html_url":"https://github.com/yugangw-msft","followers_url":"https://api.github.com/users/yugangw-msft/followers","following_url":"https://api.github.com/users/yugangw-msft/following{/other_user}","gists_url":"https://api.github.com/users/yugangw-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/yugangw-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugangw-msft/subscriptions","organizations_url":"https://api.github.com/users/yugangw-msft/orgs","repos_url":"https://api.github.com/users/yugangw-msft/repos","events_url":"https://api.github.com/users/yugangw-msft/events{/privacy}","received_events_url":"https://api.github.com/users/yugangw-msft/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T18:52:18Z","updated_at":"2015-12-02T18:52:18Z","body":"@AyeJeigh it is \"from login\". More accurately, login gets \"access token\" and \"refresh token\". The \"access token\" always expires after a hour, but with the \"refresh token\", the expired \"access token\" can be exchanged for a valid one automatically. The crucial part is the \"refresh token\" from a \"live id\" is only good for 12 hours. For org-id, the \"refresh token\", is good for 2 weeks, and can be automatically extended for another 2 weeks as long as it gets used once every 2 weeks. This can go on for up to 3 months. "}}