Examples of SAML2SSOAuthenticatorException


Examples of org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticatorException

      response = unmarshaller.unmarshall(element);
      // Check for duplicate samlp:Response
      NodeList list = response.getDOM().getElementsByTagNameNS( SAMLConstants.SAML20P_NS,"Response");
      if (list.getLength() > 0) {
        log.error("Invalid schema for the SAML2 reponse");
        throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
      }
      return response;
    } catch (ParserConfigurationException e) {
      log.error(e.getMessage());
      throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
    } catch (SAXException e) {
      log.error(e.getMessage());
      throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
    } catch (IOException e) {
      log.error(e.getMessage());
      throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
    } catch (UnmarshallingException e) {
      log.error(e.getMessage());
      throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
    }

  }
View Full Code Here

Examples of org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticatorException

            try {
                tenantID = realmService.getTenantManager().getTenantId(domainName);
            } catch (org.wso2.carbon.user.api.UserStoreException e) {
                String errorMsg = "Error getting the TenantID for the domain name";
                log.error(errorMsg, e);
                throw new SAML2SSOAuthenticatorException(errorMsg, e);
            }
        }

        KeyStoreManager keyStoreManager = null;
        try {
            // get an instance of the corresponding Key Store Manager instance
            keyStoreManager = KeyStoreManager.getInstance(registryService.getGovernanceSystemRegistry(tenantID));
        } catch (RegistryException e) {
            String errorMsg = "Error getting a KeyStore Manager instance.";
            log.error(errorMsg, e);
            throw new SAML2SSOAuthenticatorException(errorMsg, e);
        }

        X509CredentialImpl credentialImpl = null;
        try {
            if (tenantID != 0) {    // for non zero tenants, load private key from their generated key store
                KeyStore keystore = keyStoreManager.getKeyStore(generateKSNameFromDomainName(domainName));
                java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate) keystore.getCertificate(domainName);
                credentialImpl = new X509CredentialImpl(cert);
            } else {    // for tenant zero, load the default pub. cert using the config. in carbon.xml
                java.security.cert.X509Certificate cert = keyStoreManager.getDefaultPrimaryCertificate();
                credentialImpl = new X509CredentialImpl(cert);
            }
        } catch (Exception e) {
            String errorMsg = "Error instantiating an X509CredentialImpl object for the public cert.";
            log.error(errorMsg, e);
            throw new SAML2SSOAuthenticatorException(errorMsg, e);
        }
        return credentialImpl;
    }
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.