Examples of OAuth2Error


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

            // Facebook has a content type of text/plain
            // GitHub has a content type of application/x-www-form-urlencoded
            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 && accessor != null) {
            final String accessToken = msg.getAccessToken();
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) {
            ret = getError("error parsing request", null, msg.getErrorUri(),
                    msg.getErrorDescription());
          } else if (error == null && accessor != 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 testOAuth2HandlerError1() 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 testGetError1() 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, "encRequestStateKey is null", msg.getErrorUri(),
                  msg.getErrorDescription(), 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.