GlobusApp objects currently enable users to manually trigger a login flow via app.run_login_flow(), but not to check if a user already has valid tokens (i.e., logged in). I can accomplish this by interacting with the app._validating_token_storage object, but that is not a public interface, nor intuitive.
I propose creating an app.is_logged_in() method, or similar, which supports a resource_server argument. If the user does not specify a resource server, then the method could validate tokens for all associated resource servers.
In addition, we might consider creating an app.ensure_logged_in() method, or similar, which would simply run app.run_login_flow() if app.is_logged_in() returns False.
GlobusApp
objects currently enable users to manually trigger a login flow viaapp.run_login_flow()
, but not to check if a user already has valid tokens (i.e., logged in). I can accomplish this by interacting with theapp._validating_token_storage
object, but that is not a public interface, nor intuitive.I propose creating an
app.is_logged_in()
method, or similar, which supports aresource_server
argument. If the user does not specify a resource server, then the method could validate tokens for all associated resource servers.In addition, we might consider creating an
app.ensure_logged_in()
method, or similar, which would simply runapp.run_login_flow()
ifapp.is_logged_in()
returnsFalse
.