I created a simple unit for google oauth2. To get QR Code, call  UniImage1.Url:=GetQRCodeUrl(UniImage1.Width, UniImage1.Height, 'YOURSECRETKEY', 'your email address', 'Your name'); To ValidateOTP : if Format('%.6d', [CalculateOTP('YOURSECRETKEY')]) = UniEdit1.Text then begin // Valid end; Here some screenshots       GoogleAuth.pas