damirkusar / AspNetCore.Totp

Time-based One-time Password Algorithm to be used with Google Authenticator
MIT License
69 stars 28 forks source link

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

Open robinvanderknaap opened 8 months ago

robinvanderknaap commented 8 months ago

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.

hafiz-personal commented 5 months ago

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

robinvanderknaap commented 5 months ago

@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.

hafiz-personal commented 5 months ago

@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.