I am building CLI based application in golang for automation purpose for which I will be using cobra. Here user needs to login by supplying id, password and server name then golang will return client object and then that returned object will be used to call its corresponding methods. eg:-
during startup user types:-
app login --username="name" password="pwd" --server="https//someName.com"
now this login I want to retain and for subsequent commands I want to use the current session to run other commands of user
eg:- (here I dont want to authenticate user again)
app create user --username="user2"
If system is restarted then I want user to authenticate first then fire their commands
I want to follow similar behavior as followed in azure-cli