Skip to content

An (unofficial) AWS Console Federated Sign-In Tool

License

Notifications You must be signed in to change notification settings

dylanlangston/ConsoleLaunchpad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ConsoleLaunchpad πŸ•ΉοΈ

ConsoleLaunchpad πŸ•ΉοΈ

An (unofficial) AWS Console Federated Sign-In Tool

C# Avalonia GitHub Workflow CI/CD GitHub License Latest Build GitHub repo size

Overview πŸ‘€

This tool simplifies access to the AWS Console by leveraging the GetFederationToken API, allowing users to sign in swiftly and securely using their local AWS credentials. It caters to individuals who need frequent access to the AWS Console without constantly requiring them to enter their 2-Factor Authentication (2FA) details. Built with C# and Avalonia to ensure a consistent expierence across different platforms while still using a single unified codebase. This is a community effort and not affiliated with Amazon/AWS, if you're having any problems please open an issue.

Features ✨

  • πŸ”‘ Efficient Sign-In: Streamlines the sign-in process to the AWS Console by utilizing the GetFederationToken API.
  • πŸ›‘οΈ Effective Security: Offers a reasonably secure sign-in method without necessitating 2FA, suitable for users requiring regular access to the AWS Console.
  • 🌐 Cross-Platform Compatibility: Single codebase can be built for Desktop, Web, and Mobile.
  • 🎨 User-Friendly Interface: Intuitive UI design facilitates easy navigation and usage for both novice and experienced users.

Demo 🎬

Demo gif showcasing functionality coming soon...

Usage ⏯️

Detailed usage instructions coming soon...

Building πŸ—οΈ

Build instructions coming soon...

Dev Environment πŸ’»

This repository offers a streamlined development environment setup using a devcontainer.json file, allowing you to get up and running quickly with a fully-featured environment in the cloud.[1] Use one of the following links to get started:

Open in GitHub Codespaces

Open Dev Container

Open DevPod

If you want to browse the source code without the need to build, you can do so conveniently on GitHub.dev or VSCode.dev:

Edit on GitHub.dev

Open in vscode.dev

Solution Architecture 🏰

graph TD
    subgraph " "
        direction LR
        Core["ConsoleLaunchpad.Core"]
        Tests["ConsoleLaunchpad.Tests"]
        Main["ConsoleLaunchpad"]
        Browser["ConsoleLaunchpad.Browser"]
        Desktop["ConsoleLaunchpad.Desktop"]
        Imports["ConsoleLaunchpad.Imports"]
        Android["ConsoleLaunchpad.Android"]
    end

    Core -->|Business Logic| Main
    Imports -->|Application Interfaces| Main
    Main -->|User Interface| Browser
    Main -->|User Interface| Desktop
    Main -->|User Interface| Android
    Core -->|Unit Tests| Tests
    Main -->|Integration Tests| Tests
Loading

Minimal Implementation πŸ› οΈ

For anyone asking "how does this all works", here's a minimal implementation in C#:

using System;
using Amazon.IdentityManagement;
using Amazon.IdentityManagement.Model;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using Amazon.SecurityToken;
using Amazon.SecurityToken.Model;

class Program
{
    static async Task Main()
    {
        string policy = @"{
            ""Statement"": [{
                ""Effect"": ""Allow"",
                ""Action"": ""*"",
                ""Resource"": ""*""
            }]
        }"; // Your desired policy

        AWSCredentials credentials;
        CredentialProfileStoreChain chain = new CredentialProfileStoreChain();
        if (chain.TryGetAWSCredentials("profile_name", out credentials)) // Your AWS profile name
        {
            Console.WriteLine("Using local AWS profile credentials.");
        }
        else
        {
            credentials = new BasicAWSCredentials("YOUR_ACCESS_KEY_ID", "YOUR_SECRET_ACCESS_KEY"); // Your AWS credentials
        }

        using (var stsClient = new AmazonSecurityTokenServiceClient(credentials, Amazon.RegionEndpoint.USEast1)) // Replace the region if desired
        {
            GetFederationTokenRequest getTokenRequest = new()
            {
                Name = "Username",
                Policy = policy,
                DurationSeconds = 3600 // Set the duration for which the temporary credentials are valid
            };

            GetFederationTokenResponse getTokenResponse = await stsClient.GetFederationTokenAsync(getTokenRequest);

            string sessionToken = getTokenResponse.Credentials.SessionToken;
            string consoleSigninLink = $"https://signin.aws.amazon.com/federation?Action=login&Issuer=ExampleCorp&Destination=https%3A%2F%2Fconsole.aws.amazon.com%2F&SigninToken={Uri.EscapeDataString(sessionToken)}";

            Console.WriteLine($"Signed URL for AWS Console: {consoleSigninLink}");
        }
    }
}

Resources ℹ️

Here are some additional resources regarding the GetFederationToken API and its usage:

AWS IAM User Guide - Federated Users
AWS IAM User Guide - GetFederationToken
AWS STS API Reference
AWS SDK for .NET API Docs

Contributions πŸ™Œ

Contributions to this project are welcome! Feel free to submit bug reports, feature requests, or pull requests via GitHub.

License πŸ“œ

This tool is licensed under the MIT License. See the LICENSE file for details.

Support πŸ†˜

For any inquiries or assistance, please open an issue.

  1. For local development check out Dev Containers and DevPod. ↩