Thursday, June 1, 2017

OAuth with GWT against Strava API

I am trying to create a GWT application against the Strava API. The first thing to do is authentication.

On they say that for the token exchange you have to do something like :

curl -X POST \ -F client_id=5 \ -F client_secret=7b2946535949ae70f015d696d8ac602830ece412 \ -F code=75e251e3ff8fff

As far as I know those -F things represent fields in a multiform post ? 
So I created something like : 

final FormPanel form = new FormPanel(); 
VerticalPanel panel = new VerticalPanel(); 
panel.add(new Hidden("client_id", CLIENT_ID)); 
panel.add(new Hidden("client_secret", CLIENT_SECRET)); 
panel.add(new Hidden("code", code)); 
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() 
   public void onSubmitComplete(SubmitCompleteEvent event) 
      GWT.log("complete " + event.getResults()); 
container.addAttachHandler(new AttachEvent.Handler() 
   public void onAttachOrDetach(AttachEvent event) 

Now when I do this I see the following error in Chrome dev tools :

Refused to display '' in a frame because it set 'X-Frame-Options' to 'deny'. POST net::ERR_BLOCKED_BY_RESPONSE

Now the questions are. 
Am I correct by creating a form to mimic that curl example ? 
Has that frame error something to do with GWT using IFRAME stuff ? How do I fix this ?


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment