Beispiel #1
0
        public string Execute(params string[] parameters)
        {
            AccessTokenStore store = new AccessTokenStore();
            var token = store.CreateToken(Impersonate);

            return("Access token created. Use this token: " + token);
        }
        public string Execute(params string[] parameters)
        {
            int cnt = 0;
            AccessTokenStore store = new AccessTokenStore();

            foreach (var at in store.ListTokens(ShowAllTokens))
            {
                OutputToConsole?.Invoke(this, $"{at.Id}\t{at.Owner}\t{at.Created.ToShortDateString()}");
                cnt++;
            }


            return($"{cnt} access token listed. ");
        }
        public string Execute(params string[] parameters)
        {
            if (string.IsNullOrEmpty(TokenId) && parameters.Length == 1)
            {
                TokenId = parameters.First();
            }
            else if (string.IsNullOrEmpty(TokenId))
            {
                return("You have to provide a token id");
            }

            AccessTokenStore store = new AccessTokenStore();

            store.RemoveToken(TokenId);

            return("Access token removed");
        }