Examples of RadiusClient


Examples of net.jradius.client.RadiusClient

        this.inetAddress = InetAddress.getByName(hostName);
    }

    public boolean authenticate(
        final UsernamePasswordCredentials usernamePasswordCredentials) {
        final RadiusClient radiusClient = getNewRadiusClient();

        final AttributeList attributeList = new AttributeList();
        attributeList.add(new Attr_UserName(usernamePasswordCredentials
            .getUsername()));
        attributeList.add(new Attr_UserPassword(usernamePasswordCredentials
            .getPassword()));

        final AccessRequest request = new AccessRequest(radiusClient,
            attributeList);

        try {
            final RadiusPacket response = radiusClient.authenticate(request,
                this.radiusAuthenticator, this.retries);

            // accepted
            if (response instanceof AccessAccept) {
                LOG.debug("Authentication request suceeded for host:"
View Full Code Here

Examples of net.jradius.client.RadiusClient

                    + e.getMessage());
        }
    }

    private RadiusClient getNewRadiusClient() {
        return new RadiusClient(this.inetAddress, this.sharedSecret,
            this.authenticationPort, this.accountingPort, this.socketTimeout);
    }
View Full Code Here

Examples of net.sourceforge.jradiusclient.RadiusClient

    }
   
    protected User doLogon(String username, String password) throws UserDatabaseException, InvalidLoginCredentialsException, AccountLockedException {
       
        // set up RADIUS client to do authentication
        RadiusClient rc = null;
        try{
            rc = new RadiusClient(serverHostName, authPort, acctPort, sharedSecret);
        }catch(RadiusException rex){
            log.error("RadiusException: " + rex.getMessage());
        }catch(InvalidParameterException ivpex){
            log.error("Unable to create Radius Client due to invalid parameter! " +
                    "InvalidParameterException: " + ivpex.getMessage());
View Full Code Here

Examples of org.tinyradius.util.RadiusClient

    String host = args[0];
    String shared = args[1];
    String user = args[2];
    String pass = args[3];
   
    RadiusClient rc = new RadiusClient(host, shared);

    // 1. Send Access-Request
    AccessRequest ar = new AccessRequest(user, pass);
    ar.setAuthProtocol(AccessRequest.AUTH_PAP); // or AUTH_CHAP
    ar.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
    ar.addAttribute("NAS-IP-Address", "192.168.0.100");
    ar.addAttribute("Service-Type", "Login-User");
    ar.addAttribute("WISPr-Redirection-URL", "http://www.sourceforge.net/");
    ar.addAttribute("WISPr-Location-ID", "net.sourceforge.ap1");
   
    System.out.println("Packet before it is sent\n" + ar + "\n");
    RadiusPacket response = rc.authenticate(ar);
    System.out.println("Packet after it was sent\n" + ar + "\n");
    System.out.println("Response\n" + response + "\n");

    // 2. Send Accounting-Request
    AccountingRequest acc = new AccountingRequest("mw", AccountingRequest.ACCT_STATUS_TYPE_START);
    acc.addAttribute("Acct-Session-Id", "1234567890");
    acc.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
    acc.addAttribute("NAS-Port", "0");
 
    System.out.println(acc + "\n")
    response = rc.account(acc);
    System.out.println("Response: " + response);
   
    rc.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.