Examples of AccessRequest


Examples of net.jradius.packet.AccessRequest

        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);
View Full Code Here

Examples of org.tinyradius.packet.AccessRequest

   * @exception IOException communication error (after getRetryCount()
   * retries)
   */
  public synchronized boolean authenticate(String userName, String password)
  throws IOException, RadiusException {
    AccessRequest request = new AccessRequest(userName, password);
    RadiusPacket response = authenticate(request);
    return response.getPacketType() == RadiusPacket.ACCESS_ACCEPT;
  }
View Full Code Here

Examples of org.tinyradius.packet.AccessRequest

    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");
View Full Code Here

Examples of org.tinyradius.packet.AccessRequest

  public static void main(String[] args)
  throws Exception {
    InputStream source = new FileInputStream("test.dictionary");
    Dictionary dictionary = DictionaryParser.parseDictionary(source);
    AccessRequest ar = new AccessRequest("UserName", "UserPassword");
    ar.setDictionary(dictionary);
    ar.addAttribute("WISPr-Location-ID", "LocationID");
    ar.addAttribute(new IpAttribute(8, 1234567));
    System.out.println(ar);
  }
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.