コード例 #1
0
  @SuppressWarnings("unused")
  private static void callShibbAsWS()
      throws MalformedURLException, SNAAExceptionException, AuthenticationExceptionException {

    SNAA port = WisebedServiceHelper.getSNAAService("http://*****:*****@wisebed1.itm.uni-luebeck.de");
    auth1.setPassword("xxx");

    List<AuthenticationTriple> authTriples = new ArrayList<AuthenticationTriple>();
    authTriples.add(auth1);
    port.authenticate(authTriples);
    Action action = new Action();
    action.setAction("sth");
    port.isAuthorized(new ArrayList<SecretAuthenticationKey>(), action);
  }
コード例 #2
0
  @SuppressWarnings("unused")
  private static void callFederatorJVMInternal() {

    try {
      federator.authenticate(new ArrayList<AuthenticationTriple>());
    } catch (SNAAExceptionException e) {
      e.printStackTrace();
    } catch (AuthenticationExceptionException e) {
      e.printStackTrace();
    }

    try {
      Action action = new Action();
      action.setAction("sth");
      federator.isAuthorized(new ArrayList<SecretAuthenticationKey>(), action);
    } catch (SNAAExceptionException e) {
      e.printStackTrace();
    }
  }
コード例 #3
0
  @SuppressWarnings("unused")
  private static void callFederatorAsWS()
      throws MalformedURLException, SNAAExceptionException, AuthenticationExceptionException {

    SNAA port = WisebedServiceHelper.getSNAAService("http://*****:*****@wisebed1.itm.uni-luebeck.de");
    auth1.setPassword("xxx");
    authTriples.add(auth1);

    AuthenticationTriple auth2 = new AuthenticationTriple();
    auth2.setUrnPrefix("urn:wisebed:dummy1");
    auth2.setUsername("*****@*****.**");
    auth2.setPassword("xxx");
    authTriples.add(auth2);

    AuthenticationTriple auth3 = new AuthenticationTriple();
    auth3.setUrnPrefix("urn:wisebed:dummy2");
    auth3.setUsername("*****@*****.**");
    auth3.setPassword("xxx");
    authTriples.add(auth3);

    AuthenticationTriple auth4 = new AuthenticationTriple();
    auth4.setUrnPrefix("urn:wisebed:shib2");
    auth4.setUsername("*****@*****.**");
    auth4.setPassword("xxx");
    authTriples.add(auth4);

    try {
      List<SecretAuthenticationKey> keys = port.authenticate(authTriples);
      log.info("Got authentication keys: " + keys);
      Action action = new Action();
      action.setAction("sth");
      boolean b = port.isAuthorized(new ArrayList<SecretAuthenticationKey>(), action);
      log.info("Is authorized: " + b);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }