use of net.jradius.client.auth.RadiusAuthenticator in project opennms by OpenNMS.
the class RadiusAuthenticationProviderTest method testRetrieveUserChap.
@Test
@Ignore("Need to have a RADIUS server running on localhost")
public void testRetrieveUserChap() throws IOException {
RadiusAuthenticationProvider provider = new RadiusAuthenticationProvider(m_radiusServer, m_sharedSecret);
RadiusAuthenticator authTypeClass = new CHAPAuthenticator();
provider.setAuthTypeClass(authTypeClass);
provider.setRolesAttribute("Unknown-VSAttribute(5813:1)");
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(m_principal, m_credentials);
provider.retrieveUser(m_username, token);
}
use of net.jradius.client.auth.RadiusAuthenticator in project opennms by OpenNMS.
the class RadiusAuthenticationProviderTest method testRetrieveUserPap.
@Test
@Ignore("Need to have a RADIUS server running on localhost")
public void testRetrieveUserPap() throws IOException {
RadiusAuthenticationProvider provider = new RadiusAuthenticationProvider(m_radiusServer, m_sharedSecret);
RadiusAuthenticator authTypeClass = new PAPAuthenticator();
provider.setAuthTypeClass(authTypeClass);
provider.setRolesAttribute("Unknown-VSAttribute(5813:1)");
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(m_principal, m_credentials);
provider.retrieveUser(m_username, token);
}
use of net.jradius.client.auth.RadiusAuthenticator in project opennms by OpenNMS.
the class RadiusAuthenticationProviderTest method doTestRetrieveUserMultipleTimes.
public void doTestRetrieveUserMultipleTimes(RadiusAuthenticator authenticator) {
RadiusAuthenticationProvider provider = new RadiusAuthenticationProvider(m_radiusServer, m_sharedSecret);
RadiusAuthenticator authTypeClass = authenticator;
provider.setAuthTypeClass(authTypeClass);
provider.setRolesAttribute("Unknown-VSAttribute(5813:1)");
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(m_principal, m_credentials);
provider.retrieveUser(m_username, token);
provider.retrieveUser(m_username, token);
provider.retrieveUser(m_username, token);
provider.retrieveUser(m_username, token);
provider.retrieveUser(m_username, token);
provider.retrieveUser(m_username, token);
}
use of net.jradius.client.auth.RadiusAuthenticator in project opennms by OpenNMS.
the class RadiusAuthDetector method getAuthenticator.
public RadiusAuthenticator getAuthenticator() {
final RadiusAuthenticator auth;
final String authType = getAuthType();
if (authType.equalsIgnoreCase("chap")) {
auth = new CHAPAuthenticator();
} else if (authType.equalsIgnoreCase("pap")) {
auth = new PAPAuthenticator();
} else if (authType.equalsIgnoreCase("mschapv1")) {
auth = new MSCHAPv1Authenticator();
} else if (authType.equalsIgnoreCase("mschapv2")) {
auth = new MSCHAPv2Authenticator();
} else if (authType.equalsIgnoreCase("eapmd5") || authType.equalsIgnoreCase("eap-md5")) {
auth = new EAPMD5Authenticator();
} else if (authType.equalsIgnoreCase("eapmschapv2") || authType.equalsIgnoreCase("eap-mschapv2")) {
auth = new EAPMSCHAPv2Authenticator();
} else if (RadiusUtils.isEAPTTLS(authType)) {
auth = new EAPTTLSAuthenticator();
} else {
auth = null;
}
return auth;
}
use of net.jradius.client.auth.RadiusAuthenticator in project opennms by OpenNMS.
the class RadiusAuthenticationProviderTest method testRetrieveUserDefault.
@Test
@Ignore("Need to have a RADIUS server running on localhost")
public void testRetrieveUserDefault() throws IOException {
RadiusAuthenticationProvider provider = new RadiusAuthenticationProvider(m_radiusServer, m_sharedSecret);
RadiusAuthenticator authTypeClass = null;
provider.setAuthTypeClass(authTypeClass);
provider.setRolesAttribute("Unknown-VSAttribute(5813:1)");
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(m_principal, m_credentials);
provider.retrieveUser(m_username, token);
}
Aggregations