Examples of IdentityPersistenceManager


Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

  public void init() throws AxisFault, ServerException {

    try {

      boolean isInitial = false;
      IdentityPersistenceManager dbAdmin = IdentityPersistenceManager
          .getPersistanceManager();

      if (dbAdmin.getParameter(IdentityTenantUtil.getRegistry(null,null), IdentityConstants.PARAM_CARD_NAME).getValue() == null) {
        isInitial = true;
      }
     
      CryptoUtil.getDefaultCryptoUtil();
      IdentityProviderUtil.setIntial(isInitial);
            if(!isKeyStoreExisting(IdentityUtil.getProperty(IdentityConstants.ServerConfig.USER_TRUSTED_RP_STORE_LOCATION))
               || "true".equals(System.getProperty("identity.server.reload.userrp"))){
                addKeyStores();
                log.info("userRP.jks is reloaded.");
            }
      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.persistence.IdentityPersistenceManager

  /**
   * Called only when the Identity Solution is coming up for the first time
   */
  private void addParameters(Registry registry) throws Exception {
    IdentityPersistenceManager admin = IdentityPersistenceManager.getPersistanceManager();

    admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES,
        IdentityConstants.SAML10_URL + "," + IdentityConstants.SAML11_URL + ","
            + IdentityConstants.SAML20_URL + "," + IdentityConstants.OpenId.OPENID_URL);

    admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_CARD_NAME,
        IdentityConstants.PARAM_VALUE_CARD_NAME);
    admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_VALID_PERIOD,
        IdentityConstants.PARAM_VALUE_VALID_PERIOD);
  }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

                if (sessionMap.containsKey(sessionId)) {
                    SessionInfoData sessionInfoData = sessionMap.get(sessionId);
                    String subject = sessionInfoData.getSubject();
                    SAMLSSOServiceProviderDO spDO = SSOServiceProviderConfigManager.getInstance().getServiceProvider(issuer);
                    if (spDO == null) {
                        IdentityPersistenceManager identityPersistenceManager = IdentityPersistenceManager
                                .getPersistanceManager();
                        spDO = identityPersistenceManager.getServiceProvider(
                                AnonymousSessionUtil.getSystemRegistryByUserName(SAMLSSOUtil.getRegistryService(),
                                        SAMLSSOUtil.getRealmService(), subject), issuer);
                    }
                    //give priority to assertion consuming URL if specified in the request
                    if (assertionConsumerURL != null) {
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

        try {
            SSOServiceProviderConfigManager spConfigManager = SSOServiceProviderConfigManager.getInstance();
            SAMLSSOServiceProviderDO spDO = spConfigManager.getServiceProvider(authReqDTO.getIssuer());
            if (spDO == null) {
                IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceManager();
                spDO = persistenceManager.getServiceProvider(
                        AnonymousSessionUtil.getSystemRegistryByUserName(SAMLSSOUtil.getRegistryService(),
                                SAMLSSOUtil.getRealmService(), authReqDTO.getUsername()), authReqDTO.getIssuer());
            }

            //Invalid issuer
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

        serviceProviderDO.setUseFullyQualifiedUsername(serviceProviderDTO.isUseFullyQualifiedUsername());
        serviceProviderDO.setDoSingleLogout(serviceProviderDTO.isDoSingleLogout());
        serviceProviderDO.setLogoutURL(serviceProviderDTO.getLogoutURL());
        serviceProviderDO.setDoSignAssertions(serviceProviderDTO.isDoSignAssertions());
       
        IdentityPersistenceManager persistenceManager = IdentityPersistenceManager
                .getPersistanceManager();
        try {
            return persistenceManager.addServiceProvider(registry, serviceProviderDO);
        } catch (IdentityException e) {
            log.error("Error obtaining a registry for adding a new service provider", e);
            throw new IdentityException("Error obtaining a registry for adding a new service provider", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

     * @return set of RP Service Providers + file path of pub. key of generated key pair
     */
    public SAMLSSOServiceProviderInfoDTO getServiceProviders() throws IdentityException {
        SAMLSSOServiceProviderDTO[] serviceProviders = null;
        try {
            IdentityPersistenceManager persistenceManager = IdentityPersistenceManager
                    .getPersistanceManager();
            SAMLSSOServiceProviderDO[] providersSet = persistenceManager.
                    getServiceProviders(registry);
            serviceProviders = new SAMLSSOServiceProviderDTO[providersSet.length];

            for (int i = 0; i < providersSet.length; i++) {

View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

     * @return true is successful
     * @throws IdentityException
     */
    public boolean removeServiceProvider(String issuer) throws IdentityException {
        try {
            IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceManager();
            return persistenceManager.removeServiceProvider(registry, issuer);
        } catch (IdentityException e) {
            log.error("Error removing a Service Provider");
            throw new IdentityException("Error removing a Service Provider", e);
        }
    }
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.