Hello,
I’m trying to use MFA for one of my Streamlit app and running into issues with the QR code. Below is the code that is used to generate the QR code and displayed on the app screen. When I use the Google Authenticator app to scan the QR code, it throws error “Cannot interpret QR Code”.
What am I missing that will allow authenticator app to scan the QR Code? If I type the string assigned to data manually in authenticator, it adds the account and OTP verification is successful but QR code scan doesn’t works.
import streamlit as st
import otp, qr
import pyqrcode
from io import BytesIO
from PIL import Image
data = 'OYHTVLO7TC5VGU2T'
qr = pyqrcode.create(data)
buffer = BytesIO()
qr.png(buffer, scale=4)
buffer.seek(0)
img = Image.open(buffer)
st.image(img)