AspNetCore.Totp icon indicating copy to clipboard operation
AspNetCore.Totp copied to clipboard

Replace Google Chart API with QRCoder library for rendering QRCode images.

Open robinvanderknaap opened this issue 2 years ago • 3 comments

The Google Chart API has been deprecated since 2012 : https://developers.google.com/chart/image/. It is still working by the way, but nobody knows when the service will be shutdown.

I've replaced the Google Chart API with the QRCoder library, which uses .NET classes to draw the QRCode image instead of relying on an external API.

I also needed to add the SkiaSharp library to be able to resize the resulting images.

I've updated the project containing the tests to .NET 8. Due to behavioral differences when comparing strings as of .NET 5, I had to make a minor change to the Base32 decoder for the tests to succeed.

robinvanderknaap avatar Jan 05 '24 12:01 robinvanderknaap

This would be great because the Google Chart API have started to throw an unexpected error since yesterday.

hafiz-personal avatar Apr 03 '24 10:04 hafiz-personal

@hafiz-personal

FYI. After this pull request, I decided to change my strategy for rendering the QRCode. I'm rendering the QRCode in the browser instead of the backend. I still use this library for validating the tfa token in the backend.

This is the library I used for rendering the QR Code in the browser: https://github.com/soldair/node-qrcode.

robinvanderknaap avatar Apr 03 '24 11:04 robinvanderknaap

@hafiz-personal

FYI. After this pull request, I decided to change my strategy for rendering the QRCode. I'm rendering the QRCode in the browser instead of the backend. I still use this library for validating the tfa token in the backend.

This is the library I used for rendering the QR Code in the browser: https://github.com/soldair/node-qrcode.

Thank you.

hafiz-personal avatar Apr 05 '24 06:04 hafiz-personal