public class OTPPolicy extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
OTPPolicy.FreeOTP |
static class |
OTPPolicy.GoogleAuthenticator |
static interface |
OTPPolicy.OtpApp |
| Modifier and Type | Field and Description |
|---|---|
protected String |
algorithm |
static boolean |
DEFAULT_IS_REUSABLE |
static OTPPolicy |
DEFAULT_POLICY |
protected int |
digits |
protected int |
initialCounter |
protected boolean |
isCodeReusable |
protected static org.jboss.logging.Logger |
logger |
protected int |
lookAheadWindow |
protected int |
period |
static String |
REALM_REUSABLE_CODE_ATTRIBUTE |
protected String |
type |
| Constructor and Description |
|---|
OTPPolicy() |
OTPPolicy(String type,
String algorithm,
int initialCounter,
int digits,
int lookAheadWindow,
int period) |
OTPPolicy(String type,
String algorithm,
int initialCounter,
int digits,
int lookAheadWindow,
int period,
boolean isCodeReusable) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAlgorithm() |
String |
getAlgorithmKey() |
int |
getDigits() |
int |
getInitialCounter() |
String |
getKeyURI(RealmModel realm,
UserModel user,
String secret)
Constructs the
otpauth:// URI based on the Key-Uri-Format. |
int |
getLookAheadWindow() |
int |
getPeriod() |
List<String> |
getSupportedApplications() |
String |
getType() |
boolean |
isCodeReusable() |
void |
setAlgorithm(String algorithm) |
void |
setCodeReusable(boolean isReusable) |
void |
setDigits(int digits) |
void |
setInitialCounter(int initialCounter) |
void |
setLookAheadWindow(int lookAheadWindow) |
void |
setPeriod(int period) |
void |
setType(String type) |
protected static final org.jboss.logging.Logger logger
protected String type
protected String algorithm
protected int initialCounter
protected int digits
protected int lookAheadWindow
protected int period
protected boolean isCodeReusable
public static OTPPolicy DEFAULT_POLICY
public static final boolean DEFAULT_IS_REUSABLE
public static final String REALM_REUSABLE_CODE_ATTRIBUTE
public OTPPolicy()
public OTPPolicy(String type, String algorithm, int initialCounter, int digits, int lookAheadWindow, int period)
public String getAlgorithmKey()
public String getType()
public void setType(String type)
public String getAlgorithm()
public void setAlgorithm(String algorithm)
public int getInitialCounter()
public void setInitialCounter(int initialCounter)
public int getDigits()
public void setDigits(int digits)
public int getLookAheadWindow()
public void setLookAheadWindow(int lookAheadWindow)
public int getPeriod()
public void setPeriod(int period)
public boolean isCodeReusable()
public void setCodeReusable(boolean isReusable)
public String getKeyURI(RealmModel realm, UserModel user, String secret)
otpauth:// URI based on the Key-Uri-Format.realm - user - secret - otpauth:// URICopyright © 2025 JBoss by Red Hat. All rights reserved.