Examples of SecurityTokenException


Examples of com.sun.xml.wss.impl.SecurityTokenException

            String encodedData = XMLUtil.getFullTextFromChildren(this);
            try {
                data = Base64.decode(encodedData);
            } catch (Base64DecodingException bde) {
                log.log(Level.SEVERE, "WSS0301.unableto.decode.data");
                throw new SecurityTokenException("Unable to decode data", bde);
            }
            try {
                CertificateFactory certFact = CertificateFactory.getInstance("X.509");
                cert = (X509Certificate) certFact.generateCertificate(new ByteArrayInputStream(data));
            } catch (Exception e) {
View Full Code Here

Examples of com.sun.xml.wss.impl.SecurityTokenException

    private void checkCertVersion() throws SecurityTokenException {
        if (cert.getVersion() != 3||cert.getVersion() !=1) {
            log.log(Level.SEVERE,
                    "WSS0392.invalid.X509cert.version",
                    Integer.toString(cert.getVersion()));
            throw new SecurityTokenException(
                "Expected Version 1 or 3 Certificate, found Version " +
                cert.getVersion());
        }
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

        try {
            BlobCrypterSecurityToken securityToken = this.getBlobCrypterSecurityToken(regionWidget, widget);
            encryptedToken = this.encryptSecurityToken(securityToken);
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from regionWidget", e);
        }

        return encryptedToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

            //Decrypt
            Map<String, String> values = blobCrypter.unwrap(encryptedSecurityToken);
            securityToken = new BlobCrypterSecurityToken(container, domain, null, values);
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from encrypted string: " +
                    encryptedSecurityToken, e);
        }

        return securityToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

        SecurityToken securityToken = this.decryptSecurityToken(encryptedSecurityToken);

        //Make sure the person is authorized to refresh this token
        String userId = String.valueOf(userService.getAuthenticatedUser().getUsername());
        if (!securityToken.getViewerId().equalsIgnoreCase(userId)) {
            throw new SecurityTokenException("Illegal attempt by user " + userId +
                    " to refresh security token with a viewerId of " + securityToken.getViewerId());
        }

        //Create a new RegionWidget instance from it so we can use it to generate a new encrypted token
        RegionWidget regionWidget = new RegionWidgetImpl(Long.toString(securityToken.getModuleId()),
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

        try {
            BlobCrypterSecurityToken securityToken = this.getBlobCrypterSecurityToken(url, moduleId,  ownerId, userService.getAuthenticatedUser());
            encryptedToken = this.encryptSecurityToken(securityToken);
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from regionWidget", e);
        }

        return encryptedToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

            if (logger.isTraceEnabled()) {
                logger.trace("Encrypted token created from security token: " + securityToken.toString() +
                        " -- encrypted token is: " + encryptedToken);
            }
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from person gadget", e);
        }

        return encryptedToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

        try {
            BlobCrypterSecurityToken securityToken = this.getBlobCrypterSecurityToken(regionWidget);
            encryptedToken = this.encryptSecurityToken(securityToken);
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from regionWidget", e);
        }

        return encryptedToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

                    String.class, String.class, String.class, String.class);
            decryptMethod.setAccessible(true);
            securityToken = (SecurityToken) decryptMethod.invoke(null, blobCrypter, container, domain,
                    encryptedSecurityToken, null);
        } catch (Exception e) {
            throw new SecurityTokenException("Error creating security token from encrypted string: " +
                    encryptedSecurityToken, e);
        }

        return securityToken;
    }
View Full Code Here

Examples of org.apache.rave.provider.opensocial.exception.SecurityTokenException

        SecurityToken securityToken = this.decryptSecurityToken(encryptedSecurityToken);

        //Make sure the person is authorized to refresh this token
        String userId = String.valueOf(userService.getAuthenticatedUser().getId());
        if (!securityToken.getViewerId().equalsIgnoreCase(userId)) {
            throw new SecurityTokenException("Illegal attempt by user " + userId +
                    " to refresh security token with a viewerId of " + securityToken.getViewerId());
        }

        //Create a new RegionWidget instance from it so we can use it to generate a new encrypted token
        RegionWidget regionWidget = new RegionWidget(securityToken.getModuleId(),
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.