Register user using API-KEY as QR code [API-KEY][PHONE NUMBER]
Once user registered, use below for each login session. Phone Number to be concatenated with API-KEY
URL:
https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json
curl "https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json"
import java.io.*;
import java.net.*;
public class FirebaseGetExample {
public static void main(String[] args) {
try {
String url = "https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json";
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) response.append(inputLine);
in.close();
System.out.println("Response:\\n" + response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
import requests
url = "https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json"
response = requests.get(url)
if response.status_code == 200:
print("Response:", response.json())
else:
print("Error:", response.status_code)
fetch("https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json")
.then(response => response.json())
.then(data => console.log("Response:", data))
.catch(error => console.error("Error:", error));
const axios = require('axios');
axios.get('https://smatter3fa-default-rtdb.firebaseio.com/api/[api-key][phone-number-with-country-code].json')
.then(res => console.log(res.data))
.catch(err => console.error(err));
A post verification button-manual needs to be added which will be pressed once user has scanned the QR on Smatter 3FA
URL:
https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json
curl "https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json"
import java.io.*;
import java.net.*;
public class FirebaseGetResponse {
public static void main(String[] args) {
try {
String url = "https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json";
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) response.append(inputLine);
in.close();
System.out.println("Response:\\n" + response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
import requests
url = "https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json"
response = requests.get(url)
if response.status_code == 200:
print("Response:", response.json())
else:
print("Error:", response.status_code)
fetch("https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json")
.then(response => response.json())
.then(data => console.log("Response:", data))
.catch(error => console.error("Error:", error));
const axios = require('axios');
axios.get('https://smatter3fa-default-rtdb.firebaseio.com/response/[api-key][phone-number-with-country-code].json')
.then(res => console.log(res.data))
.catch(err => console.error(err));