• daniel.cecil.dev
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

Hello,

 

I'm having a couple of problems with OAuth today...

I can authenticate using the Web server flow to obtain an access token along with a refresh token.

 

However, when it comes to refreshing the refresh token I'm always greeted with an unsupported_grant_type error.

 

Here is the request:

Server: https://login.salesforce.com/services/oauth2/token

Headers:

Content-Type: application/json; charset=UTF-8
Accept: application/json

 POST Data:

{"grant_type":"refresh_token","client_id":"MY_CLIENT_ID","refresh_token":"MY_REFRESH_TOKEN"}

Raw Response:

HTTP/1.1 400 Bad Request
Date: Wed, 19 Jun 2013 10:18:38 GMT
Pragma: no-cache
Cache-Control: no-cache, no-store
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked


{
  "error" : "unsupported_grant_type",
  "error_description" : "grant type not supported"
}

 

Any ideas? The refresh token is brand new.

 

Thanks,

Dan

Hello,

 

I'm trying to format a date's month in the user's language but keep getting it in English.

Here's the code I have:

 

Datetime d = System.now();
Datetime thisDate = DateTime.newInstance(d.year(), d.month(), d.day());
String format = thisDate.format('MMMM');
System.debug(format);

 Any ideas?

Many thanks, Dan

Hello,

 

I'm trying to format a date's month in the user's language but keep getting it in English.

Here's the code I have:

 

Datetime d = System.now();
Datetime thisDate = DateTime.newInstance(d.year(), d.month(), d.day());
String format = thisDate.format('MMMM');
System.debug(format);

 Any ideas?

Many thanks, Dan

Hello,

 

I'm trying to format a date's month in the user's language but keep getting it in English.

Here's the code I have:

 

Datetime d = System.now();
Datetime thisDate = DateTime.newInstance(d.year(), d.month(), d.day());
String format = thisDate.format('MMMM');
System.debug(format);

 Any ideas?

Many thanks, Dan