gauth-decode
v0.1.1
Published
A package to decode Google Authenticator export data
Downloads
92
Maintainers
Readme
gauth-decode
A NPM package to decode Google Authenticator export data
Usage
import { decodeMigrationUri } from "gauth-decode";
void decodeMigrationUri("otpauth-migration://offline?data=Ch8KBdFBKZJTEgpUZXN0IFRva2VuGgQyRkFTIAEoATACEAEYASAAKIji6ej7%2F%2F%2F%2F%2FwE%3D").then(result = console.log(result));
output:
[
{
algorithm: "ALGO_SHA1",
digits: 1,
issuer: "2FAS",
name: "Test Token",
secret: "0UEpklM=",
secretBase32: "2FASTEST",
type: "OTP_TOTP"
}
]
Sample data
A sample TOTP QR code from 2FAS:
Contained URI data: otpauth://totp/Test%20Token?secret=2FASTEST&issuer=2FAS
The same sample data exported from Google authenticator:
Contained URI data: otpauth-migration://offline?data=Ch8KBdFBKZJTEgpUZXN0IFRva2VuGgQyRkFTIAEoATACEAEYASAAKIji6ej7%2F%2F%2F%2F%2FwE%3D
and this can be decoded using this package.
Thanks to
- google-authenticator-exporter project to which the entire code is based upon.
- TypeScript NPM Package Publishing: A Beginner’s Guide