Package javax.ws.rs

Examples of javax.ws.rs.NotAuthorizedException


   
    private byte[] getServiceTicket(String encodedServiceTicket) {
        try {
            return Base64Utility.decode(encodedServiceTicket);
        } catch (Base64Exception ex) {
            throw new NotAuthorizedException(getFaultResponse());
        }
    }
View Full Code Here


    protected void throwFault(String error, Exception ex) {
        // TODO: get bundle resource message once this filter is moved
        // to rt/rs/security
        LOG.warning(error);
        Response response = Response.status(401).entity(error).build();
        throw ex != null ? new NotAuthorizedException(response, ex) : new NotAuthorizedException(response);
    }
View Full Code Here

                client = getAndValidateClient(authInfo[0], authInfo[1]);
            }
        }
       
        if (client == null) {
            throw new NotAuthorizedException(Response.status(401).build());
        }
        return client;
    }
View Full Code Here

            return client;
        }
        if (clientSecret == null || client.getClientSecret() == null
            || !client.getClientId().equals(clientId)
            || !client.getClientSecret().equals(clientSecret)) {
            throw new NotAuthorizedException(Response.status(401).build());
        }
        return client;
    }
View Full Code Here

        if (issuer != null) {
            String actualIssuer = getIssuer(wrapper);
            String expectedIssuer = OAuthConstants.CLIENT_ID.equals(issuer)
                ? wrapper.getSaml2().getSubject().getNameID().getValue() : issuer;
            if (actualIssuer == null || !actualIssuer.equals(expectedIssuer)) {
                throw new NotAuthorizedException(errorResponse());
            }
        }
        if (!validateAuthenticationSubject(message, cs, wrapper.getSaml2().getSubject())) {
            throw new NotAuthorizedException(errorResponse());
        }
    }
View Full Code Here

                if (absoluteAddress.equals(a.getAudienceURI())) {
                    return;
                }
            }
        }
        throw new NotAuthorizedException(errorResponse());
    }
View Full Code Here

        if (subjectConfData == null) {
            if (!subjectConfirmationDataRequired
                && cs.getNotOnOrAfter() != null && !cs.getNotOnOrAfter().isBeforeNow()) {
                return;
            }
            throw new NotAuthorizedException(errorResponse());
        }
         
        // Recipient must match assertion consumer URL
        String recipient = subjectConfData.getRecipient();
        if (recipient == null || !recipient.equals(getAbsoluteTargetAddress(m))) {
            throw new NotAuthorizedException(errorResponse());
        }
         
        // We must have a NotOnOrAfter timestamp
        if (subjectConfData.getNotOnOrAfter() == null
            || subjectConfData.getNotOnOrAfter().isBeforeNow()) {
            throw new NotAuthorizedException(errorResponse());
        }
         
        //TODO: replay cache, same as with SAML SSO case
         
        // Check address
        if (subjectConfData.getAddress() != null
            && (clientAddress == null || !subjectConfData.getAddress().equals(clientAddress))) {
            throw new NotAuthorizedException(errorResponse());
        }
         
         
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.NotAuthorizedException

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.