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

micro-app-onetime-password

v1.0.0

Published

Simple micro-app to generate onetime passwords

Downloads

6

Readme

micro-app-onetime-password

Micro app to generate onetime passwords needed to login to services like github when two-factor authentication is enabled.

Note since the totp password is easily obtained from the browser once the app is started, it is only suitable where you have good physical control over the client (as well as the server of course), for example the computer in your house.

sample onetime password page

Usage

After installation modify ../lib/config.json to match your configuration

The configuration entries that must be updated include:

  • totp_secret - the encrypted version of your totp secret. You can use the utility in the micro-app framework to generated the encrypted value. It is called .../node_modules/micro-app-framework/lib/enc_config_value.js The first parameter is the value to be encrypted and the second is the password that will be used to authenticate to the micro app
  • authInfo.password - the hashed password tha will be used to authenticate to the micro-app. This can be generated with the utility in the micro-app framework which is called: .../node_modules/micro-app-framework/lib/gen_password.js. The first parameter is the password to be hashed.
  • change authInfo.userid
  • optionally change authInfo.realm

NOTE you need to use the same password to encrypt the totp_secret and for the pre-hashed value used for authInfo.password.

In addition since tls is enabled you will need to generate a certificate and key for the server which need to be stored in the ../lib directory for the onetime-password micro-app and need to be called:

  • cert.pem
  • key.pem

As an example the configuration file that comes with the install is:

Installation

Simply run npm install micr-app-onetime-password

Running

To run the onetime-password app, add node.js to your path (currently requires 4.x or better) and then run:

From the directory in the micro-app-onetime-password was installed.

Once the server is started. Point your browser at the host/port for the server. If you have configured your browswer to allow javascript to close the current page the original window will be closed and one with the correct size of the onetime password app page will be created.

You will need to provide the userid/password as configured in .../lib/config.json

Example

The following is the page shown for my configuration:

sample onetime password page

Key Depdencies

micro-app-framework

As a micro-app the onetime password app depends on the micro-app-framework:

See the documentation on the micro-app-framework for more information on general configurtion options that are availble (ex using tls, authentication, serverPort, etc)

Acknowledgements

Base32 decoding is from link

TODO

  • Second version where totp secret is kept only in the server to improve security
  • nicer page layout
  • improve page size calculation and or precision of the sizes of the entries