You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I manage apps under my personal account as well as an enterprise account, so I often switch from one to the other, i.e. heroku logout && heroku login --sso
It would be nice if the CLI would:
remember my org so I don't have to type it
not make me type --sso
not make me copy and paste a token from browser to terminal
not expire my enterprise session so quickly
allow me to switch between profiles easily, à la ghub.io/npmrc
I know some of these are probably difficult, but any one of them would help reduce friction.
great suggestions! I've considered in the past storing the fact that sso was used in the netrc file so it's known that we should use that method the next time there is a login, but it's a little tricky how to do that since heroku logout essentially wipes that information. Is there a reason why you have to run heroku logout first that you're aware of? Or can you just run heroku login --sso? If the latter is true (and I think it is) then that flag is pretty easy to add to make it default to sso.
For org remembering, I feel the best way to do that would be to set the HEROKU_ORGANIZATION environment variable which would work today. Perhaps we could set some global state for the last used org, but I worry that may surprise people.
I'll have to take a look at session expiration. It's possible it may be set to a current time for compliance reasons of some sort, but we may be able to make that configurable.
@zeke would you mind sending a support ticket regarding the session length? that's out of @heroku/cli's hands and we're the only ones that look at github
@zeke the timeout for SSO is 8 hours. Not sure if you ever opened that support ticket, but certainly do so if you are constantly being logged out in less than that time.
@jdxcode one comment I have seen is that when SSO does expire the default login flow is not for SSO. So customers need to cancel that login, and rerun heroku login --sso it would be nice if it defaulted to flow used in the previous session.
A thought: I no longer use the HEROKU_ORGANIZATION environment variable because it messes up non-SSO logins. So that means I'm back to typing in the org name whenever I run heroku login --sso. It would be nice to have an --org option.
@zeke I appreciate your patience. We're finally working on this and I've made a few improvements. It should now default to sso if it used sso last and it should fill in the org into that field. I'm hoping to also make the copy+paste not necessary either by moving to a web-based login but this is going to take a bit more time (if it's feasible that is)
Activity
jdx commentedon Jul 9, 2017
great suggestions! I've considered in the past storing the fact that sso was used in the netrc file so it's known that we should use that method the next time there is a login, but it's a little tricky how to do that since
heroku logoutessentially wipes that information. Is there a reason why you have to runheroku logoutfirst that you're aware of? Or can you just runheroku login --sso? If the latter is true (and I think it is) then that flag is pretty easy to add to make it default to sso.May need to add a
--no-ssoto unset it though.For switching profiles, use the heroku-accounts plugin: https://github.com/heroku/heroku-accounts
For org remembering, I feel the best way to do that would be to set the
HEROKU_ORGANIZATIONenvironment variable which would work today. Perhaps we could set some global state for the last used org, but I worry that may surprise people.I'll have to take a look at session expiration. It's possible it may be set to a current time for compliance reasons of some sort, but we may be able to make that configurable.
zeke commentedon Jul 9, 2017
Awesome stuff, thanks.
No. It was just an assumption on my part.
👍
👍
Thanks! Good enough for me. Feel free to close this. :)
jdx commentedon Jul 9, 2017
I'd like to keep it open until we add the netrc remembering, I think that's useful functionality
zeke commentedon Nov 30, 2017
Friendly bump.
Enterprise session length is still very short, and I have to log in quite often.
jdx commentedon Dec 1, 2017
@zeke would you mind sending a support ticket regarding the session length? that's out of @heroku/cli's hands and we're the only ones that look at github
zeke commentedon Dec 2, 2017
Done. 🤞
kwlockwo commentedon Mar 15, 2018
@zeke the timeout for SSO is 8 hours. Not sure if you ever opened that support ticket, but certainly do so if you are constantly being logged out in less than that time.
@jdxcode one comment I have seen is that when SSO does expire the default login flow is not for SSO. So customers need to cancel that login, and rerun
heroku login --ssoit would be nice if it defaulted to flow used in the previous session.zeke commentedon Mar 16, 2018
Here's the ticket I opened in December 2017: https://help.heroku.com/tickets/534061
The last Heroku response was:
... but never heard anything beyond that, and the ticket is now closed.
jdx commentedon Mar 16, 2018
we should make the CLI remember the setting, but I feel even then an 8 hour timeout makes this experience subpar
zeke commentedon Mar 16, 2018
Agreed.
zeke commentedon Apr 18, 2018
A thought: I no longer use the
HEROKU_ORGANIZATIONenvironment variable because it messes up non-SSO logins. So that means I'm back to typing in the org name whenever I runheroku login --sso. It would be nice to have an--orgoption.jdx commentedon May 7, 2018
@zeke I appreciate your patience. We're finally working on this and I've made a few improvements. It should now default to sso if it used sso last and it should fill in the org into that field. I'm hoping to also make the copy+paste not necessary either by moving to a web-based login but this is going to take a bit more time (if it's feasible that is)
zeke commentedon May 7, 2018
Thanks!
Can you clarify what you mean by this? Are you saying the CLI accepts a new argument?
jdx commentedon May 7, 2018
No, the prompt for
Organization:will now default to the last used organization so you don't need to setHEROKU_ORGANIZATIONanymorezeke commentedon May 8, 2018
Nice. Just gave it a try but hit a few snags: #836
jdx commentedon Oct 16, 2018
Hey everyone, we just finished a new browser based login which should improve this even more (no more copy+paste)
Try it out with
heroku update beta && heroku login