Examples of OAuthException


Examples of net.oauth.OAuthException

                if (certObject != null) {
                    publicKey = loadPublicKey(certObject, true);
                }
            }
        } catch (GeneralSecurityException e) {
            throw new OAuthException(e);
        } catch (IOException e) {
            throw new OAuthException(e);
        }
    }
View Full Code Here

Examples of net.oauth.OAuthException

    protected String getSignature(String baseString) throws OAuthException {
        try {
            byte[] signature = sign(baseString.getBytes(OAuth.ENCODING));
            return base64Encode(signature);
        } catch (UnsupportedEncodingException e) {
            throw new OAuthException(e);
        } catch (GeneralSecurityException e) {
            throw new OAuthException(e);
        }
    }
View Full Code Here

Examples of net.oauth.OAuthException

            throws OAuthException {
        try {
            return verify(decodeBase64(signature),
                          baseString.getBytes(OAuth.ENCODING));
        } catch (UnsupportedEncodingException e) {
            throw new OAuthException(e);
        } catch (GeneralSecurityException e) {
            throw new OAuthException(e);
        }
    }
View Full Code Here

Examples of net.oauth.OAuthException

    protected String getSignature(String baseString) throws OAuthException {
        try {
            String signature = base64Encode(computeSignature(baseString));
            return signature;
        } catch (GeneralSecurityException e) {
            throw new OAuthException(e);
        } catch (UnsupportedEncodingException e) {
            throw new OAuthException(e);
        }
    }
View Full Code Here

Examples of net.oauth.OAuthException

        try {
            byte[] expected = computeSignature(baseString);
            byte[] actual = decodeBase64(signature);
            return equals(expected, actual);
        } catch (GeneralSecurityException e) {
            throw new OAuthException(e);
        } catch (UnsupportedEncodingException e) {
            throw new OAuthException(e);
        }
    }
View Full Code Here

Examples of net.oauth.OAuthException

      if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Signature base string: " + OAuthSignatureMethod.getBaseString(message));
      }
      VALIDATOR.validateMessage(message, accessor);
    } catch (NoSuchAlgorithmException e) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (URISyntaxException e) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (OAuthException e) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (IOException e) {
      throw new OAuthException("Error validating OAuth request", e);
    }
  }
View Full Code Here

Examples of org.eclipse.orion.server.authentication.oauth.OAuthException

    if(type.equals("google")){
      oauthParams = new GoogleOAuthParams(req, login);
    }else if(type.equals("github")){
      oauthParams = new GitHubOAuthParams(req, login);
    }else{
      throw new OAuthException("No OAuth provider given");
    }
    return getOAuthParams();
  }
View Full Code Here

Examples of org.gatein.security.oauth.exception.OAuthException

            msg.setArgsLocalized(false);
            uiApp.addMessage(msg);
        }

        // Show message about failed social account linking
        OAuthException gtnOAuthException = (OAuthException)httpSession.getAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_AFTER_FAILED_LINK);
        if (gtnOAuthException != null) {
            httpSession.removeAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_AFTER_FAILED_LINK);

            Object[] args = new Object[] {gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_USERNAME),
                    gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_NAME)};
            ApplicationMessage appMessage = new ApplicationMessage("UIAccountSocial.msg.failed-link", args, ApplicationMessage.WARNING);
            appMessage.setArgsLocalized(false);
            uiApp.addMessage(appMessage);
        }

        // Show message about failed OAuth2 flow
        gtnOAuthException = (OAuthException)httpSession.getAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_OAUTH);
        if (gtnOAuthException != null) {
            httpSession.removeAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_OAUTH);

            String key;
            if (gtnOAuthException.getExceptionCode() == OAuthExceptionCode.USER_DENIED_SCOPE) {
                key = "UIAccountSocial.msg.access-denied";
            } else {
                key = "UIAccountSocial.msg.oauth-error";

                log.error("Unspecified error during OAuth flow", gtnOAuthException);
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthException

            update("UPDATE request_tokens SET verifier='" + verifier + "' "
                    + "WHERE token='" + requestToken + "'");
        
            return verifier;
         } catch (SQLException ex) {
             throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED,
                     "Request token for the consumer with key " + consumerKey + " can not be authorized");
         }
    }
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthException

                String scopes = rs.getString("scopes");
                String permissions = rs.getString("permissions");
                String tokenConsumerKey = rs.getString("consumer_key");
               
                if (consumerKey != null && !tokenConsumerKey.equals(consumerKey)) {
                    throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
                }
               
                return new OAuthToken(token, secret,
                        scopes == null ? null : new String[] {scopes},
                        permissions == null ? null : new String[] {permissions},       
                        -1, getConsumer(tokenConsumerKey));
            } else {
                throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
            }
        } catch (SQLException ex) {
            throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
        }
    }
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.