private ServerManager getServerManager() {
    ServerManager manager =
        (ServerManager)
            IWMainApplication.getDefaultIWApplicationContext()
                .getApplicationAttribute(OpenIDConstants.ATTRIBUTE_SERVER_MANAGER);
    if (manager == null) {
      String endPointUrl =
          IWMainApplication.getDefaultIWApplicationContext()
              .getApplicationSettings()
              .getProperty(OpenIDConstants.PROPERTY_END_POINT_URL, "http://localhost:8080/");
      String userSetupUrl =
          IWMainApplication.getDefaultIWApplicationContext()
              .getApplicationSettings()
              .getProperty(
                  OpenIDConstants.PROPERTY_USER_SETUP_URL,
                  "http://localhost:8080/pages/profile/?doRedirect=true");

      manager = new ServerManager();
      manager.setSharedAssociations(new InMemoryServerAssociationStore());
      manager.setPrivateAssociations(new InMemoryServerAssociationStore());

      manager.setOPEndpointUrl(endPointUrl);
      manager.setUserSetupUrl(userSetupUrl);
      IWMainApplication.getDefaultIWApplicationContext()
          .setApplicationAttribute(OpenIDConstants.ATTRIBUTE_SERVER_MANAGER, manager);
    }

    return manager;
  }
示例#2
0
  OpenIdTestService(
      String url,
      Map<IdProperty, String> props,
      Set<String> teams,
      List<ProcessExtension> extensions) {
    this.url = url;
    this.endpointUrl = url + "endpoint";

    this.props = props;
    this.teams = teams;
    this.extensions = extensions;

    manager = new ServerManager();
    manager.setSharedAssociations(new InMemoryServerAssociationStore());
    manager.setPrivateAssociations(new InMemoryServerAssociationStore());
    manager.setOPEndpointUrl(endpointUrl);
  }