QRCode generation

Hello developers! I have a problem how i can generate QRcode with this i am use this simple script:

local HttpService = game:GetService("HttpService")
local AuthAPI = {}

local AUTHENTICATION_URL = "https://www.authenticatorapi.com/Validate.aspx?Pin=%s&SecretCode=%s"
local QRCODE_URL = "https://www.authenticatorapi.com/pair.aspx?AppName=%s&AppInfo=%s&SecretCode=%s"

function AuthAPI.CheckPinAsync(
	code: string | number,
	secret: string
): boolean

	assert(
		tonumber(code) ~= nil,
		"Code must be number"
	)

	assert(
		typeof(secret) == 'string',
		"Secret must be string"
	)

	local requestUrl = string.format(
		AUTHENTICATION_URL,
		code, secret
	)

	local wasRequestSuccessful, result = pcall(
		HttpService.GetAsync, HttpService,
		requestUrl
	)

	if wasRequestSuccessful then
		if result == "True" then
			return true
		elseif result == "False" then
			return false
		else
			error("Invalid result returned\n Result: ".. result)
		end
	else
		error("Remote request failed\n Error: ".. result)
	end
end

function AuthAPI.GetQRCodeURL(
	appName: string,
	appInfo: string,
	secret: string
): string

	assert(
		typeof(appName) == 'string',
		"AppName must be string"
	)

	assert(
		typeof(appInfo) == 'string',
		"AppInfo must be string"
	)

	assert(
		typeof(secret) == 'string',
		"Secret must be string"
	)

	return string.format(
		QRCODE_URL,
		appName, appInfo, secret
	)
end

return AuthAPI

and this activator

local authapi = require(game:GetService("ReplicatedStorage").AuthAPI)
local qrencode = require(game:GetService("ReplicatedStorage").qrencode)


local qr = authapi.GetQRCodeURL("RandommmTestApp", "Random application", "abcdefg1234")
qrencode.creategui(qr, 2).Parent = game.StarterGui

But if i use this method qrcode dont working. Pls help!

1 Like

If i use authapi.GetQRCodeURL i getting this

1 Like

i’ve tried uploading a qr code before and it gave me a warning, so i don’t think qr codes are allowed

I have QRCode generator. It generate frames at gui

You can only do HTTP requests on the server. It’s blocked on the client. (If you’re calling GetQRCodeURL on the client.)

I succeeded, I carefully looked at the code and the method for obtaining the QR code, then I converted the QR Code into text and got this: “otpauth://totp/”…Name…“?secret=”…SecretCode…"&issuer= "…appName

This scannable
Working!


image
image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.