Examples of OAuth2Error


Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

    OAuth2Accessor accessor = null;
    try {
      final OAuth2Message msg = this.oauth2MessageProvider.get();
      msg.parseRequest(request);
      final OAuth2Error error = msg.getError();
      final String requestStateKey = msg.getState();
      if (requestStateKey == null) {
        if (error != null) {
          OAuth2CallbackServlet.sendError(error, msg.getErrorDescription(), msg.getErrorUri(),
              null, resp, null);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

            }
            ret = TokenAuthorizationResponseHandler.getError("Unhandled Content-Type "
                + contentType);
          }

          final OAuth2Error error = msg.getError();
          if ((error == null) && (accessor != null)) {
            final String accessToken = msg.getAccessToken();
            final String refreshToken = msg.getRefreshToken();
            final String expiresIn = msg.getExpiresIn();
            final String tokenType = msg.getTokenType();
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

        } else {
          if (log.isLoggable(Level.FINEST)) {
            log.logp(Level.FINEST, CLASS, method, "refresh errors reported");
          }
          // There was an error refreshing, stop.
          final OAuth2Error error = handlerError.getError();
          ret = this.getErrorResponseBuilder(handlerError.getCause(), error,
              handlerError.getContextMessage(), handlerError.getUri(),
              handlerError.getDescription());
        }
      }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

   * @return True if the OAuth message is valid false otherwise.
   * @throws IOException Thrown when there is an error writing the error response.
   */
  protected boolean isOAuthMsgValid(OAuth2Message msg, HttpServletResponse resp) throws IOException {
    boolean result = true;
    final OAuth2Error error = msg.getError();
    if (error != null) {
      sendError(error, "encRequestStateKey is null", msg.getErrorDescription(),
          msg.getErrorUri(), null, resp, null, this.sendTraceToClient);
      result = false;
    }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

          } else {
            // Facebook does this
            msg.parseQuery('?' + responseString)
          }

          final OAuth2Error error = msg.getError();
          if (error != null) {
            ret = getError("error parsing request", null, msg.getErrorUri(),
                msg.getErrorDescription());
          } else if (error == null) {
            final String accessToken = msg.getAccessToken();
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

import org.junit.Test;

public class OAuth2HandlerErrorTest {
  @Test
  public void testOAuth2HandlerError_1() throws Exception {
    final OAuth2Error error = OAuth2Error.AUTHENTICATION_PROBLEM;
    final String contextMessage = "";
    final Exception cause = new Exception();

    final OAuth2HandlerError result = new OAuth2HandlerError(error, contextMessage, cause);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

  @Test
  public void testGetError_1() throws Exception {
    final OAuth2HandlerError fixture = new OAuth2HandlerError(OAuth2Error.AUTHENTICATION_PROBLEM,
        "", new Exception());

    final OAuth2Error result = fixture.getError();

    Assert.assertNotNull(result);
    Assert.assertEquals("authentication_problem", result.getErrorCode());
    Assert.assertEquals("AUTHENTICATION_PROBLEM", result.name());
    Assert.assertEquals(2, result.ordinal());
    Assert.assertEquals("AUTHENTICATION_PROBLEM", result.toString());
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

    OAuth2Accessor accessor = null;
    try {
      final OAuth2Message msg = this.oauth2MessageProvider.get();
      msg.parseRequest(request);
      final OAuth2Error error = msg.getError();
      final String encRequestStateKey = msg.getState();
      if (encRequestStateKey == null) {
        if (error != null) {
          OAuth2CallbackServlet.sendError(error, msg.getErrorDescription(), msg.getErrorUri(),
                  null, resp, null);
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

            }
            ret = TokenAuthorizationResponseHandler.getError("Unhandled Content-Type "
                    + contentType);
          }

          final OAuth2Error error = msg.getError();
          if (error == null && accessor != null) {
            final String accessToken = msg.getAccessToken();
            final String refreshToken = msg.getRefreshToken();
            final String expiresIn = msg.getExpiresIn();
            final String tokenType = msg.getTokenType();
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth2.OAuth2Error

    OAuth2Accessor accessor = null;
    try {
      final OAuth2Message msg = this.oauth2MessageProvider.get();
      msg.parseRequest(request);
      final OAuth2Error error = msg.getError();
      final String encRequestStateKey = msg.getState();
      if (encRequestStateKey == null) {
        if (error != null) {
          OAuth2CallbackServlet.sendError(error, "encRequestStateKey is null", msg.getErrorDescription(),
                  msg.getErrorUri(), null, resp, null, this.sendTraceToClient);
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.