code: public void refreshAccessToken() throws WnsException {
          WebTarget target = client.target(getAuthenticationUri());
  
          MultivaluedStringMap formData = new MultivaluedStringMap();
          formData.add("grant_type", GRANT_TYPE_CLIENT_CREDENTIALS);
          formData.add("client_id", this.sid);
          formData.add("client_secret", this.clientSecret);
          formData.add("scope", SCOPE);
          Response response = target.request(MediaType.APPLICATION_FORM_URLENCODED_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).post(Entity.form(formData));
  
          if (response.getStatus() != 200) {
              throw new WnsException("Authentication failed. HTTP error code: " + response.getStatus());
          }
  
          this.token = response.readEntity(WnsOAuthToken.class);
      }
docs: Based on <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx</a>
  
  @throws WnsException when authentication fails