Here is a Java code that worked for me. hope it helps

// Lookup the secret that corresponds to the oauth_consumer_key
String oauth_secret = "it_is_suppose_to_be_a_secret";
                String oauth_consumer_key = "AlanCrooksKey";


String requestTokenURL = "http://AlanCrooks/requesttoken";;
String userAuthorizationURL = "http://AlanCrooks/authorizetoken";;
        String accessTokenURL = "http://AlanCrooks/accesstoken";;
    OAuthServiceProvider  serviceprovider = new
OAuthServiceProvider(requestTokenURL,userAuthorizationURL,accessTokenURL);

OAuthMessage oam = OAuthServlet.getMessage(request, null);
OAuthValidator oav = new SimpleOAuthValidator();
OAuthConsumer cons = new
OAuthConsumer("about:blank#OAuth+CallBack+NotUsed",oauth_consumer_key,
oauth_secret, null);

OAuthAccessor acc = new OAuthAccessor(cons);
        String message = "   ";

String base_string = null;
try {
base_string = OAuthSignatureMethod.getBaseString(oam);
} catch (Exception e) {
base_string = "null";
mv.addObject("message",base_string);
}

try {
oav.validateMessage(oam,acc);
} catch(Exception e) {
System.out.println("Provider failed to validate message");
System.out.println(e.getMessage());
message = e.getMessage();
mv.addObject("message",message);
if ( base_string != null ) System.out.println(base_string);

}

On Mon, May 9, 2011 at 7:50 AM, Alan Crooks <[email protected]>wrote:

> Hi lukethor.
>
> Seems to work fine through your test client code. I wonder what I'm doing
> wrong? I noticed when I did the "dump request" option that oauth_signature
> was completely different from the one I put in which was my consumer_secret.
> Is that a security feature or am I supposed to do something with
> consumer_secret before I submit it in the https request?
>
> Alan.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Apps Domain Information and Management APIs" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Apps Domain Information and Management APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to