DEV Community


Discussion on: Selenium Testing - How to sign in to Two-factor authentication?

jigisha9 profile image
jigisha9 • Edited


Hi Jsakamoto, We are getting QR Code URL from some 3rd party w/o having any secret key nor they give any option to convert to secret key. Is there any way I can convert QR code to secret key? otherwise I won't able to use your code to get authorized.

Please guide.

Java code:

String otpKeyStr = "6jm7n6xwitpjooh7ihewyyzeux7aqmw2" //secret key

j_sakamoto profile image
jsakamoto Author

Yes, you may can do it.

The Java Library "Zixing" is useful for decoding QR code images.

"Zixing" is here:

Also, you can find many questions and answers about decoding QR code images on "Stack Overflow".com.

I propose to search on Google with the keyword "java how to decode qr zxing".