Examples of RelyingPartyDO


Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

                ppidValueDO = new PPIDValueDO();
                ppidValueDO.setUserId(name);
                ppidValueDO.setPpid(newPpid);

                // If the host is globally trusted
                RelyingPartyDO rp = db.getGloballyTrustedRelyingParty(IdentityTenantUtil
                        .getRegistry(null, name), appliesToHostName);
                if (rp != null) {
                    ppidValueDO.setRelyingParty(rp);
                } else {
                    // Else the host MUST be personally trusted
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

     *
     * @param rpName
     * @throws AxisFault
     */
    public void createGloabllyTrustedRelyingParty(String rpName) throws AxisFault {
        RelyingPartyDO rp = new RelyingPartyDO();
        rp.setHostName(rpName);
        try {
            dbMan.createGloabllyTrustedRelyingParty(getRegsitry(), rp);
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

     */
    protected X509Certificate readRpCertFromStores(RahasData data) throws IdentityProviderException {
        X509Certificate cert = null;
        IdentityPersistenceManager dbman = null;
        String host = null;
        RelyingPartyDO rp = null;
        String alias = null;
        String keyStoreName = null;
        ServerConfiguration serverConfig = null;

        host = IdentityProviderUtil.getAppliesToHostName(data);
        serverConfig = ServerConfiguration.getInstance();
        String userName = UserCoreUtil.getTenantLessUsername(userIdentifier);

        try {
            dbman = IdentityPersistenceManager.getPersistanceManager();
        } catch (Exception e) {
            log.error("Error while instantiating IdentityUserStore", e);
            throw new IdentityProviderException("Error while instantiating IdentityUserStore", e);
        }

        try {
      rp = dbman.getGloballyTrustedRelyingParty(IdentityTenantUtil
          .getRegistry(null, userName), host);
    } catch (Exception ignore) {
      // Lets proceed with the user trusted relying parties.
    }

        keyStoreName = serverConfig.getFirstProperty("Security.KeyStore.Location");

        if (rp != null) {
            // This is a globally trusted RP
            alias = rp.getAlias();
            // Get key store name
            try {
                cert = KeyUtil.getCertificate(new File(keyStoreName).getName(), alias);
            } catch (IdentityException e) {
                log.error("Error while retrieving cert from the key store", e);
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

            }
      if (isInitial) {
        addParameters(IdentityTenantUtil.getRegistry(null,null));

                 // Add the globally trusted relying party
        RelyingPartyDO rp = new RelyingPartyDO();

        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        if (serverConfig.getFirstProperty("HostName") != null) {
          rp.setHostName(serverConfig.getFirstProperty("HostName"));
          rp.setAlias(serverConfig.getFirstProperty("HostName"));
        } else {
          rp.setHostName("localhost");
          rp.setAlias("localhost");
        }

        rp.setAlias(serverConfig.getFirstProperty("Security.KeyStore.KeyAlias"));
        dbAdmin.createGloabllyTrustedRelyingParty(IdentityTenantUtil.getRegistry(null,null), rp);
      }
    } catch (Exception e) {
      throw new AxisFault(e.getMessage(), e);
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

  /**
   * {@inheritDoc}
   */
  protected RelyingPartyDO resourceToObject(Resource resource) {
    RelyingPartyDO rp = null;

    if (resource != null) {
      rp = new RelyingPartyDO();
      rp.setHostName(resource.getProperty(IdentityRegistryResources.PROP_HOST_NAME));
      rp.setAlias(resource.getProperty(IdentityRegistryResources.PROP_ALIAS));
    }
    return rp;
  }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

    /**
     * {@inheritDoc}
     */
    protected PPIDValueDO resourceToObject(Resource resource) {
        PPIDValueDO ppid = null;
        RelyingPartyDO rp = null;
        if (resource != null) {
            ppid = new PPIDValueDO();
            rp = new RelyingPartyDO();
            ppid.setHostName(resource.getProperty(IdentityRegistryResources.PROP_HOST_NAME));
            rp.setHostName(resource.getProperty(IdentityRegistryResources.PROP_HOST_NAME));
            ppid.setRelyingParty(rp);
            ppid.setUserId(resource.getProperty(IdentityRegistryResources.PROP_USER_ID));
            ppid.setPpid(addSpecialCharacters(resource
                    .getProperty(IdentityRegistryResources.PROP_PPID)));
        }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

   * @throws IdentityException
   */
  public void create(RelyingPartyDO rp) throws IdentityException {
    String uuid = null;
    String path = null;
    RelyingPartyDO rpdo = null;
    Resource resource = null;

    if (log.isDebugEnabled()) {
      log.debug("Creating new relying party");
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

   * @param hostName
   * @return
   * @throws IdentityException
   */
  public RelyingPartyDO getRelyingPartyDO(String hostName) throws IdentityException {
    RelyingPartyDO rp = null;

    if (log.isDebugEnabled()) {
      log.debug("Retreiving relying party for host " + hostName);
    }

View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

   * @param hostName
   * @throws IdentityException
   */
  public void createPPIDValueForRP(PPIDValueDO ppidValue, String hostName)
      throws IdentityException {
    RelyingPartyDO rp = null;
    String path = null;
    Resource resource = null;

    if (log.isDebugEnabled()) {
      log.debug("Creating PPID for user relying party");
    }

    try {
      rp = getFirstObjectWithPropertyValue(IdentityRegistryResources.RELYING_PARTY,
          IdentityRegistryResources.PROP_HOST_NAME, hostName);
      if (rp == null) {
        if (log.isDebugEnabled()) {
          log.debug("Rrelying party already exists");
        }
        return;
      }
      path = IdentityRegistryResources.RELYING_PARTY + rp.getUuid() + "/"
          + ppidValue.getUserId() + "/" + ppidValue.getPpid();
      resource = registry.get(path);
      registry.put(path, resource);
    } catch (RegistryException e) {
      log.error("Error while creating PPID for user relying party", e);
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.RelyingPartyDO

   * @throws IdentityException
   */
  public PPIDValueDO[] getIssuedPPIDvaluesForUser(String userId, String hostName)
      throws IdentityException {
    PPIDValueDO[] vals = new PPIDValueDO[0];
    RelyingPartyDO rp = null;
    List<PPIDValueDO> lst = null;
    String path = null;
    Collection collection = null;
    String[] children = null;

    if (log.isDebugEnabled()) {
      log.debug("Retreiving PPIDs for user " + userId);
    }

    try {
      rp = getFirstObjectWithPropertyValue(IdentityRegistryResources.RELYING_PARTY,
          IdentityRegistryResources.PROP_HOST_NAME, hostName);
      if (rp == null) {
        // TODO
        return vals;
      }
      lst = new ArrayList<PPIDValueDO>();
      path = IdentityRegistryResources.RELYING_PARTY + rp.getUuid() + "/" + userId;
      collection = (Collection) registry.get(path);
      children = collection.getChildren();
      for (String child : children) {
        int index = child.lastIndexOf("/");
        String ppid = child.substring(index);
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.