PR #5 raised the issue of the issuer parameter being unavailable. This PR adds support for more (all) of the otpauth URI parameters (including issuer) by exposing a fluent URI builder interface. It also maintains backwards compatibility with the previous interface.
It should also be more compatible with the available specs I could find (1, 2, & 3), in that free-form strings are now correctly URI-encoded.
Using one of the examples, otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example would be generated with:
(new GoogleAuthenticator())
->getUriBuilder()
->issuer("Example")
->account("alice@google.com")
->secret("JBSWY3DPEHPK3PXP")
->getUri();
PR #5 raised the issue of the
issuer
parameter being unavailable. This PR adds support for more (all) of the otpauth URI parameters (including issuer) by exposing a fluent URI builder interface. It also maintains backwards compatibility with the previous interface.It should also be more compatible with the available specs I could find (1, 2, & 3), in that free-form strings are now correctly URI-encoded.
Using one of the examples,
otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example
would be generated with: