Package org.wso2.carbon.identity.authenticator.saml2.sso.ui.builders

Examples of org.wso2.carbon.identity.authenticator.saml2.sso.ui.builders.LogoutRequestBuilder


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

    private static final Log log = LogFactory.getLog(SAML2SSOAuthenticatorDSComponent.class);

    protected void activate(ComponentContext ctxt) {
        SAML2SSOAuthBEDataHolder.getInstance().setBundleContext(ctxt.getBundleContext());
        SAML2SSOAuthenticator authenticator = new SAML2SSOAuthenticator();
        Hashtable<String, String> props = new Hashtable<String, String>();
        props.put(CarbonConstants.AUTHENTICATOR_TYPE, authenticator.getAuthenticatorName());
        ctxt.getBundleContext().registerService(CarbonServerAuthenticator.class.getName(), authenticator, props);

        // todo : remove debug message
        log.info("SAML2 SSO Authenticator BE Bundle activated successfuly.");
View Full Code Here

      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

            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

    public SAML2SSOAuthenticationClient(ConfigurationContext ctx, String serverURL, String cookie,
            HttpSession session) throws Exception {
        this.session = session;
        String serviceEPR = serverURL + "SAML2SSOAuthenticationService";
        stub = new SAML2SSOAuthenticationServiceStub(ctx, serviceEPR);
        ServiceClient client = stub._getServiceClient();
        Options options = client.getOptions();
        options.setManageSession(true);
        if (cookie != null) {
            options.setProperty(HTTPConstants.COOKIE_STRING, cookie);
View Full Code Here

        }
    }

    public boolean login(String samlResp, String username) throws AuthenticationException {
        try {
            AuthnReqDTO authDTO = new AuthnReqDTO();
            authDTO.setResponse(samlResp);
            boolean authStatus = stub.login(authDTO);
            setAdminCookie(authStatus);
            //Add an entry to the CarbonSSOSessionManager
            return authStatus;
        } catch (RemoteException e) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.identity.authenticator.saml2.sso.ui.builders.LogoutRequestBuilder

Copyright © 2018 www.massapicom. 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.