mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-26 16:56:09 +00:00
Merge pull request #366 from alexbakker/steam-otpauth
Add support for otpauth://steam URI's
This commit is contained in:
commit
8c0ba2dd1b
1 changed files with 13 additions and 1 deletions
|
@ -25,7 +25,11 @@ public class GoogleAuthInfo {
|
||||||
builder.scheme("otpauth");
|
builder.scheme("otpauth");
|
||||||
|
|
||||||
if (_info instanceof TotpInfo) {
|
if (_info instanceof TotpInfo) {
|
||||||
|
if (_info instanceof SteamInfo) {
|
||||||
|
builder.authority("steam");
|
||||||
|
} else {
|
||||||
builder.authority("totp");
|
builder.authority("totp");
|
||||||
|
}
|
||||||
builder.appendQueryParameter("period", Integer.toString(((TotpInfo)_info).getPeriod()));
|
builder.appendQueryParameter("period", Integer.toString(((TotpInfo)_info).getPeriod()));
|
||||||
} else if (_info instanceof HotpInfo) {
|
} else if (_info instanceof HotpInfo) {
|
||||||
builder.authority("hotp");
|
builder.authority("hotp");
|
||||||
|
@ -89,6 +93,14 @@ public class GoogleAuthInfo {
|
||||||
}
|
}
|
||||||
info = totpInfo;
|
info = totpInfo;
|
||||||
break;
|
break;
|
||||||
|
case "steam":
|
||||||
|
SteamInfo steamInfo = new SteamInfo(secret);
|
||||||
|
period = uri.getQueryParameter("period");
|
||||||
|
if (period != null) {
|
||||||
|
steamInfo.setPeriod(Integer.parseInt(period));
|
||||||
|
}
|
||||||
|
info = steamInfo;
|
||||||
|
break;
|
||||||
case "hotp":
|
case "hotp":
|
||||||
HotpInfo hotpInfo = new HotpInfo(secret);
|
HotpInfo hotpInfo = new HotpInfo(secret);
|
||||||
String counter = uri.getQueryParameter("counter");
|
String counter = uri.getQueryParameter("counter");
|
||||||
|
|
Loading…
Add table
Reference in a new issue