// Path: src/main/java/io/stalk/common/oauth/OAuthConfig.java
// public class OAuthConfig {
// 
//     private final String _consumerKey;
//     private final String _consumerSecret;
//     private final String _callbackUrl;
//     private final String _signatureMethod;
//     private final String _transportName;
//     private String id;
//     private Class<?> providerImplClass;
// 
// 
//     public OAuthConfig(final String consumerKey, final String consumerSecret, final String callbackUrl,
//                        final String signatureMethod, final String transportName) {
//         _consumerKey = consumerKey;
//         _consumerSecret = consumerSecret;
//         if (signatureMethod == null || signatureMethod.length() == 0) {
//             _signatureMethod = Constants.HMACSHA1_SIGNATURE;
//         } else {
//             _signatureMethod = signatureMethod;
//         }
//         if (transportName == null || transportName.length() == 0) {
//             _transportName = MethodType.GET.toString();
//         } else {
//             _transportName = transportName;
//         }
//         if (callbackUrl == null || callbackUrl.length() == 0) {
//             _callbackUrl = "";
//         } else {
//             _callbackUrl = callbackUrl;
//         }
// 
//     }
// 
//     public OAuthConfig(final String consumerKey, final String consumerSecret, final String callbackUrl) {
//         _consumerKey = consumerKey;
//         _consumerSecret = consumerSecret;
//         _transportName = MethodType.GET.toString();
//         _signatureMethod = Constants.HMACSHA1_SIGNATURE;
// 
// 
//         if (callbackUrl == null || callbackUrl.length() == 0) {
//             _callbackUrl = "";
//         } else {
//             _callbackUrl = callbackUrl;
//         }
//     }
// 
//     public String get_consumerKey() {
//         return _consumerKey;
//     }
// 
//     public String get_consumerSecret() {
//         return _consumerSecret;
//     }
// 
//     public String get_callbackUrl() {
//         return _callbackUrl;
//     }
// 
//     public String get_signatureMethod() {
//         return _signatureMethod;
//     }
// 
//     public String get_transportName() {
//         return _transportName;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(final String id) {
//         this.id = id;
//     }
// 
//     public Class<?> getProviderImplClass() {
//         return providerImplClass;
//     }
// 
//     public void setProviderImplClass(final Class<?> providerImplClass) {
//         this.providerImplClass = providerImplClass;
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder result = new StringBuilder();
//         String NEW_LINE = System.getProperty("line.separator");
//         result.append(this.getClass().getName() + " Object {" + NEW_LINE);
//         result.append(" consumerKey: " + _consumerKey + NEW_LINE);
//         result.append(" consumerSecret: " + _consumerSecret + NEW_LINE);
//         result.append(" signatureMethod: " + _signatureMethod + NEW_LINE);
//         result.append(" transportName: " + _transportName + NEW_LINE);
//         result.append(" id: " + id + NEW_LINE);
//         result.append(" providerImplClass: " + providerImplClass + NEW_LINE);
//         result.append("}");
//         return result.toString();
//     }
// 
// 
// }
// 
// Path: src/main/java/io/stalk/common/oauth/exception/SocialAuthException.java
// public class SocialAuthException extends Exception {
// 
//     /**
//      *
//      */
//     private static final long serialVersionUID = -6856436294292027306L;
// 
//     public SocialAuthException() {
//         super();
//     }
// 
//     public SocialAuthException(final String message) {
//         super(message);
//     }
// 
//     public SocialAuthException(final Throwable cause) {
//         super(cause);
//     }
// 
//     public SocialAuthException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// }


import io.stalk.common.oauth.OAuthConfig;
import io.stalk.common.oauth.exception.SocialAuthException;
import io.stalk.common.oauth.utils.*;
import java.util.Map;

        this.providerId = config.getId();
        this.successUrl = config.get_callbackUrl();
    }

    @Override
    public RequestToken getLoginRedirectURL() throws Exception {
        AccessGrant requestToken = oauth.getRequestToken(
                endpoints.get(Constants.OAUTH_REQUEST_TOKEN_URL), successUrl);
        String authUrl = endpoints.get(Constants.OAUTH_AUTHORIZATION_URL);
        if (scope != null) {
            authUrl += scope;
        }
        StringBuilder urlBuffer = oauth.buildAuthUrl(authUrl, requestToken, successUrl);
        System.out.println("Redirection to following URL should happen : " + urlBuffer.toString());

        return new RequestToken(urlBuffer.toString(), requestToken);
    }

    @Override
    public AccessGrant verifyResponse(AccessGrant requestToken,
                                      Map<String, String> requestParams) throws Exception {
        return verifyResponse(requestToken, requestParams, MethodType.GET.toString());
    }

    @Override
    public AccessGrant verifyResponse(
            AccessGrant requestToken,
            Map<String, String> requestParams, String methodType)
            throws Exception {
        if (requestToken == null) {

// Path: src/main/java/io/stalk/common/oauth/OAuthConfig.java
// public class OAuthConfig {
// 
//     private final String _consumerKey;
//     private final String _consumerSecret;
//     private final String _callbackUrl;
//     private final String _signatureMethod;
//     private final String _transportName;
//     private String id;
//     private Class<?> providerImplClass;
// 
// 
//     public OAuthConfig(final String consumerKey, final String consumerSecret, final String callbackUrl,
//                        final String signatureMethod, final String transportName) {
//         _consumerKey = consumerKey;
//         _consumerSecret = consumerSecret;
//         if (signatureMethod == null || signatureMethod.length() == 0) {
//             _signatureMethod = Constants.HMACSHA1_SIGNATURE;
//         } else {
//             _signatureMethod = signatureMethod;
//         }
//         if (transportName == null || transportName.length() == 0) {
//             _transportName = MethodType.GET.toString();
//         } else {
//             _transportName = transportName;
//         }
//         if (callbackUrl == null || callbackUrl.length() == 0) {
//             _callbackUrl = "";
//         } else {
//             _callbackUrl = callbackUrl;
//         }
// 
//     }
// 
//     public OAuthConfig(final String consumerKey, final String consumerSecret, final String callbackUrl) {
//         _consumerKey = consumerKey;
//         _consumerSecret = consumerSecret;
//         _transportName = MethodType.GET.toString();
//         _signatureMethod = Constants.HMACSHA1_SIGNATURE;
// 
// 
//         if (callbackUrl == null || callbackUrl.length() == 0) {
//             _callbackUrl = "";
//         } else {
//             _callbackUrl = callbackUrl;
//         }
//     }
// 
//     public String get_consumerKey() {
//         return _consumerKey;
//     }
// 
//     public String get_consumerSecret() {
//         return _consumerSecret;
//     }
// 
//     public String get_callbackUrl() {
//         return _callbackUrl;
//     }
// 
//     public String get_signatureMethod() {
//         return _signatureMethod;
//     }
// 
//     public String get_transportName() {
//         return _transportName;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(final String id) {
//         this.id = id;
//     }
// 
//     public Class<?> getProviderImplClass() {
//         return providerImplClass;
//     }
// 
//     public void setProviderImplClass(final Class<?> providerImplClass) {
//         this.providerImplClass = providerImplClass;
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder result = new StringBuilder();
//         String NEW_LINE = System.getProperty("line.separator");
//         result.append(this.getClass().getName() + " Object {" + NEW_LINE);
//         result.append(" consumerKey: " + _consumerKey + NEW_LINE);
//         result.append(" consumerSecret: " + _consumerSecret + NEW_LINE);
//         result.append(" signatureMethod: " + _signatureMethod + NEW_LINE);
//         result.append(" transportName: " + _transportName + NEW_LINE);
//         result.append(" id: " + id + NEW_LINE);
//         result.append(" providerImplClass: " + providerImplClass + NEW_LINE);
//         result.append("}");
//         return result.toString();
//     }
// 
// 
// }
// 
// Path: src/main/java/io/stalk/common/oauth/exception/SocialAuthException.java
// public class SocialAuthException extends Exception {
// 
//     /**
//      *
//      */
//     private static final long serialVersionUID = -6856436294292027306L;
// 
//     public SocialAuthException() {
//         super();
//     }
// 
//     public SocialAuthException(final String message) {
//         super(message);
//     }
// 
//     public SocialAuthException(final Throwable cause) {
//         super(cause);
//     }
// 
//     public SocialAuthException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/main/java/io/stalk/common/oauth/strategy/OAuth1.java
import io.stalk.common.oauth.OAuthConfig;
import io.stalk.common.oauth.exception.SocialAuthException;
import io.stalk.common.oauth.utils.*;
import java.util.Map;

        this.providerId = config.getId();
        this.successUrl = config.get_callbackUrl();
    }

    @Override
    public RequestToken getLoginRedirectURL() throws Exception {
        AccessGrant requestToken = oauth.getRequestToken(
                endpoints.get(Constants.OAUTH_REQUEST_TOKEN_URL), successUrl);
        String authUrl = endpoints.get(Constants.OAUTH_AUTHORIZATION_URL);
        if (scope != null) {
            authUrl += scope;
        }
        StringBuilder urlBuffer = oauth.buildAuthUrl(authUrl, requestToken, successUrl);
        System.out.println("Redirection to following URL should happen : " + urlBuffer.toString());

        return new RequestToken(urlBuffer.toString(), requestToken);
    }

    @Override
    public AccessGrant verifyResponse(AccessGrant requestToken,
                                      Map<String, String> requestParams) throws Exception {
        return verifyResponse(requestToken, requestParams, MethodType.GET.toString());
    }

    @Override
    public AccessGrant verifyResponse(
            AccessGrant requestToken,
            Map<String, String> requestParams, String methodType)
            throws Exception {
        if (requestToken == null) {

            throw new SocialAuthException("Request token is null");
