Ejemplo n.º 1
0
        private static void GetToken()
        {
            AmazonMFAToken token = AwsCredentialHelper.GetMFAToken(_tokenProfileName);

            if (_copyToClipboard)
            {
                CopyToClipboard(token.TokenCode);
            }

            Console.WriteLine(token.TokenCode);
        }
Ejemplo n.º 2
0
        private static void GetTemporaryCredentials()
        {
            var account = GetAccount();

            var credentials = AwsCredentialHelper.GetTemporaryCredentials(_credentialProfileName, _tokenProfileName, account).Result;

            Console.WriteLine($"aws_access_key_id={credentials.AccessKeyId}");
            Console.WriteLine($"aws_secret_access_key={credentials.SecretAccessKey}");
            Console.WriteLine($"aws_session_token={credentials.SessionToken}");
            Console.Read();
        }
Ejemplo n.º 3
0
        public async Task Open()
        {
            var credentials = await AwsCredentialHelper.GetTemporaryCredentials(_credentialProfileName, _tokenProfileName, _account);

            var signinToken = await GetSigninToken(credentials);

            var consoleUrl = $"https://{_account.Region.SystemName}.console.aws.amazon.com/console/home";

            var loginUrl = $"https://signin.aws.amazon.com/federation?Action=login&Destination={WebUtility.UrlEncode(consoleUrl)}&SigninToken={WebUtility.UrlEncode(signinToken)}";

            OpenBrowser(loginUrl, _account.AccountNumber);
        }