npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-credful

v1.1.2

Published

CLI for obtaining AWS temporary credentials from a SAML browser login

Downloads

759

Readme

AWS CLI creds from any IDP: aws-credful

This tool, aws-credful, makes it easy to obtain AWS CLI credentials from web browser single sign-on (SSO). Unlike similar tools that support a single identity provider (IDP) such as Microsoft ADFS or Okta, aws-credful opens a web browser popup and lets you use any IDP that your organization has connected to your AWS accounts. Multiple AWS accounts and roles are also supported (as long as they are set up properly in your IDP).

Installation

npm install --global aws-credful

Usage

Options:
  --version     Show version number                                    [boolean]
  --url, -u     URL that starts your single-sign on process to AWS in the
                browser (or set AWS_CREDFUL_URL)                           [string]
  --output, -o  <profile name>:<role arn> - you can specify this argument
                multiple times for multiple profiles                     [array]
  --all         Instead of outputs, save all roles, using role name as profile
                name. Does not dedupe role names                       [boolean]
  --list-roles  Just list the available roles and quit                 [boolean]
  --hours       Duration in hours to request from STS               [default: 1]
  -h, --help    Show help                                              [boolean]

Finding the URL

The --url paramter requires the URL you would go to in your browser for an identity provider (IDP) initiated login to AWS. Generally, you would find this by going to the "apps" screen your IDP offers and copying the URL from the link to AWS.

If you select AWS from a drop-down during the single sign-on process (as in some ADFS setups), specify the generic single sign-on URL, and you'll have to select AWS from the dropdown during the login process each time.

Why Electron?

In the past, I've both built and used CLIs for this purpose that make direct HTTP requests to the IDP, parse HTML, and interact directly with the login and MFA forms. Although this approach is widely used and officially recommended on the AWS blog, it's fragile, hard to adapt to MFA and Captchas, and entirely IDP-specific.

By popping up a browser window from the CLI, we bypass nearly all of the fragility and just let the browser-based login process be what it wants to be: a browser-based login process.

We also get free cookies (meaning, we're not starting a new blank session every time and can take advantage of session cookies for re-logins). This is especially helpful with G Suite, since it can add a Captcha and email you every time you log into using an unfamiliar device (i.e. one with no cookies). Cookie duration is of course subject to your IDP's limits, just as it would be in a regular web browser.

Version support

Node 16-20.

Maintainers