use of org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetDigitsOrderFromRegistry.
@Test
public void testGetDigitsOrderFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.ORDER, "backward");
Assert.assertEquals(SMSOTPUtils.getDigitsOrder(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "backward");
}
use of org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetScreenUserAttributeFromRegistry.
@Test
public void testGetScreenUserAttributeFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.SCREEN_USER_ATTRIBUTE, "http://wso2.org/claims/mobile");
Assert.assertEquals(SMSOTPUtils.getScreenUserAttribute(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "http://wso2.org/claims/mobile");
}
use of org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetErrorPageFromXMLFileFromRegistry.
@Test
public void testGetErrorPageFromXMLFileFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.SMSOTP_AUTHENTICATION_ERROR_PAGE_URL, SMSOTPConstants.ERROR_PAGE);
Assert.assertEquals(SMSOTPUtils.getErrorPageFromXMLFile(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "smsotpauthenticationendpoint/smsotpError.jsp");
}
use of org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetMobileNumberRequestPageFromRegistry.
@Test
public void testGetMobileNumberRequestPageFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.MOBILE_NUMBER_REQ_PAGE, "smsotpauthenticationendpoint/mobile.jsp");
Assert.assertEquals(SMSOTPUtils.getMobileNumberRequestPage(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "smsotpauthenticationendpoint/mobile.jsp");
}
use of org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testIsSMSOTPMandatoryFromRegistry.
@Test
public void testIsSMSOTPMandatoryFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.IS_SMSOTP_MANDATORY, "true");
Assert.assertEquals(SMSOTPUtils.isSMSOTPMandatory(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), true);
}
Aggregations