Package org.candlepin.common.exceptions

Examples of org.candlepin.common.exceptions.UnauthorizedException


                    }

                    return principal;
                }
                else {
                    throw new UnauthorizedException(i18n.tr("Invalid Credentials"));
                }
            }
        }
        catch (CandlepinException e) {
            if (log.isDebugEnabled()) {
View Full Code Here


            if (securityHole != null && securityHole.noAuth()) {
                log.debug("No auth allowed for resource; setting NoAuth principal");
                principal = new NoAuthPrincipal();
            }
            else {
                throw new UnauthorizedException("Invalid credentials.");
            }
        }

        // Expose the principal for Resteasy to inject via @Context
        ResteasyProviderFactory.pushContext(Principal.class, principal);
View Full Code Here

            log.debug("OAuth Problem", e);

            // XXX: for some reason invalid signature (like bad password) has a
            // status code of 200. make it 401 unauthorized instead.
            if (e.getProblem().equals("signature_invalid")) {
                throw new UnauthorizedException(
                    i18n.tr("Invalid oauth unit or secret"));
            }
            Response.Status returnCode = Response.Status.fromStatusCode(e
                .getHttpStatusCode());
            String message = i18n.tr("OAuth problem encountered. Internal message is: {0}",
View Full Code Here

     */
    protected OAuthAccessor getAccessor(OAuthMessage msg) {
        try {
            OAuthAccessor accessor = accessors.get(msg.getConsumerKey());
            if (accessor == null) {
                throw new UnauthorizedException(
                    i18n.tr("Invalid oauth unit or secret"));
            }
            return accessor;
        }
        catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.candlepin.common.exceptions.UnauthorizedException

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.