Skip to content

Email address in place of username and domain #9

@fdiengdoh

Description

@fdiengdoh

First of all thanks for this simple yet effective code.

I'm not so sure if this is the right place to ask about this, but I would like to mention that while generating QR code this code is used

TokenAuth6238::getBarCodeUrl( 'user', 'domain', $secretkey, 'websiteservice' ))

now when scan by an app, it shows user@domain. The problem is as a user, I may find it difficult to link the two, when I use an email to login to a service. So, as a developer, I want to implement something like this

TokenAuth6238::getBarCodeUrl( 'email@address',$secretkey, 'websiteservice' ))

For my project I'm planning to tweak the core code as follows

public static function getBarCodeUrl($useremail, $secretkey, $issuer) {
      $url = "http://chart.apis.google.com/chart";
      $url = $url . "?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/";
      $url = $url . $useremail . "%3Fsecret%3D" . $secretkey . '%26issuer%3D' . rawurlencode($issuer);
      
      return $url;
    }

But I'm afraid it would break there is any update to this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions