We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc27fa5 commit 7705e8bCopy full SHA for 7705e8b
oathtool_from_otpauth_uri
@@ -98,6 +98,12 @@ if [ -z "$secret" ]; then
98
exit 2
99
fi
100
101
+# Remove any padding from the end of the secret string
102
+# While no padding should be included with the secret, according to the
103
+# key uri spec, it doesn't hurt to remove it at this stage.
104
+# Source: https://github.com/google/google-authenticator/wiki/Key-Uri-Format#secret
105
+secret=$(echo "$secret" | sed 's/\(=\|%3D\)\+$//i')
106
+
107
# Algorithm, only for TOTP
108
if [ "$otp_type" = "totp" ]; then
109
totp_algorithm=$(uri_get_query_value "$otpauth_uri" algorithm)
0 commit comments