summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Janssen <rob@devcorner.nl>2014-09-20 01:57:43 +0200
committerRob Janssen <rob@devcorner.nl>2014-09-20 01:57:43 +0200
commitd1ca8f05bc3c8b61205ce922ab646f8e3d8d25f0 (patch)
tree1fec540f2f4a6e36d9fd8603a8f0962a58da0892
parent36f2afe68b40561dcfd6ca50494b7ceea3b075e0 (diff)
downloadTwoFactorAuth-d1ca8f05bc3c8b61205ce922ab646f8e3d8d25f0.zip
TwoFactorAuth-d1ca8f05bc3c8b61205ce922ab646f8e3d8d25f0.tar.gz
TwoFactorAuth-d1ca8f05bc3c8b61205ce922ab646f8e3d8d25f0.tar.bz2
* Minor text improvements in README
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index d2eae5a..ccde486 100644
--- a/README.md
+++ b/README.md
@@ -86,24 +86,24 @@ getQRCodeImageAsDataUri($label, $secret, $size = 200)
### QR-code providers
-As mentioned before, this class comes with three 'built-in' QR-code providers. This chapter will touch the subject a bit but most of it should be self-explanatory. The `TwoFactorAuth`-class accepts a `$qrcodeprovider` parameter which lets you specify a built-in or custom QR-code provider. All three built-in providers do a simple HTTP request to retrieve an image using cURL and implement the `IQRCodeProvider` interface. Which is all you need to implement to write your own QR-code provider.
+As mentioned before, this class comes with three 'built-in' QR-code providers. This chapter will touch the subject a bit but most of it should be self-explanatory. The `TwoFactorAuth`-class accepts a `$qrcodeprovider` parameter which lets you specify a built-in or custom QR-code provider. All three built-in providers do a simple HTTP request to retrieve an image using cURL and implement the `IQRCodeProvider` interface which is all you need to implement to write your own QR-code provider.
The default provider is the `GoogleQRCodeProvider` which uses the [Google Chart Tools](https://developers.google.com/chart/infographics/docs/qr_codes) to render QR-codes. Then we have the `QRServerProvider` which uses the [goqr.me API](http://goqr.me/api/doc/create-qr-code/) and finally we have the `QRicketProvider` which uses the [QRickit API](http://qrickit.com/qrickit_apps/qrickit_api.php). All three inherit from a common (abstract) base-class named `BaseHTTPQRCodeProvider` because all three share the same functionality: retrieve an image from a 3rd party. All three classes have constructors that allow you to tweak some settings and most, if not all, arguments should speak for themselves. If you're not sure which values are supported, click the links in this paragraph for documentation on the API's that are utilized by these classes.
-If you don't like any of the built-in classes because you don't want to rely on external resources for example or because you're paranoid about sending the TOTP data to these 3rd parties (which is useless to them since they miss the at least one other factor in the [MFA process](http://en.wikipedia.org/wiki/Multi-factor_authentication)) feel tree to implement your own. The `IQRCodeProvider` interface couldn't be simpler. All you need to do is implement 2 methods:
+If you don't like any of the built-in classes because you don't want to rely on external resources for example or because you're paranoid about sending the TOTP data to these 3rd parties (which is useless to them since they miss *at least one* other factor in the [MFA process](http://en.wikipedia.org/wiki/Multi-factor_authentication)), feel tree to implement your own. The `IQRCodeProvider` interface couldn't be any simpler. All you need to do is implement 2 methods:
````php
getMimeType();
getQRCodeImage($qrtext, $size);
````
-The `getMimeType()` method should return the [MIME type](http://en.wikipedia.org/wiki/Internet_media_type) of the image that is returned by `getQRCodeImage()`. This is usually simply `image/png`. The `getQRCodeImage()` method is passed two arguments: `$qrtext` and `$size`. The latter, `$size`, is simply the width/height of the image desired by the caller. The first, `$qrtext` is the text that should be encoded in the QR-code. An example of such a text would be:
+The `getMimeType()` method should return the [MIME type](http://en.wikipedia.org/wiki/Internet_media_type) of the image that is returned by our implementation of `getQRCodeImage()`. IN this example it's simply `image/png`. The `getQRCodeImage()` method is passed two arguments: `$qrtext` and `$size`. The latter, `$size`, is simply the width/height of the image desired by the caller. The first, `$qrtext` is the text that should be encoded in the QR-code. An example of such a text would be:
`otpauth://totp/LABEL:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=ISSUER`
-All you need to do is return the QR-code as binary image data and you're done. All parts of the `$qrtext` have been escaped for you; you may need to escape the entire `$qtext` just once more when passing it as a (single) parameter to another server.
+All you need to do is return the QR-code as binary image data and you're done. All parts of the `$qrtext` have been escaped for you (but note: you *may* need to escape the entire `$qtext` just once more when passing the data to another server as GET-parameter).
-Let's see if we can use [PHP QR Code](http://phpqrcode.sourceforge.net/) to implement our own provider. We start with downloading the [required file](https://github.com/t0k4rt/phpqrcode/blob/master/phpqrcode.php) and putting it in our `src/` directory where `TwoFactorAuth.php` is located as well. Now let's implement the provider: create another file named `myprovider.php` in the `src` directory and paste in this content:
+Let's see if we can use [PHP QR Code](http://phpqrcode.sourceforge.net/) to implement our own provider. We start with downloading the [required (single) file](https://github.com/t0k4rt/phpqrcode/blob/master/phpqrcode.php) and putting it in our `src/` directory where `TwoFactorAuth.php` is located as well. Now let's implement the provider: create another file named `myprovider.php` in the `src` directory and paste in this content:
````php
<?php
@@ -126,7 +126,7 @@ class MyProvider implements IQRCodeProvider {
}
````
-That's it. We're done! We've implemented our own provider (with help of PHP QR Code). Now Let's *use* our provider:
+That's it. We're done! We've implemented our own provider (with help of PHP QR Code). No more external dependencies, no more unnecessary latencies. Now Let's *use* our provider:
````php
<?php