I am unable to find official guide containing the description (methods, properties etc) of this Salesforce inbuilt class (OAuth2).

Can someone let me know ?

  • As far as I'm aware, there is no such class. What is the "namespace" for this class? – sfdcfox Jan 28 '16 at 23:52
  • salesforce.stackexchange.com/questions/25021/… In this post, Mohith (first answer) has mentioned this class in his code. I too am unable to find info regarding this class. – Rainmaker Jan 28 '16 at 23:58

The OAuth2 class you mentioned is outlined in the bottom of that post:

/*To get aouthentication detail Wrapper*/
public class OAuth2{
 public String id{get;set;}
 public String issued_at{get;set;}
 public String instance_url{get;set;}
 public String signature{get;set;}
 public String access_token{get;set;}    

It's simply used by JSON.deserialize to get the parameters from the OAuth2 response (which is in JSON form) so that you can read the various parts of the authentication response.

There is no standard class called OAuth2.

  • 1
    Guess I should read the whole code before jumping.....Should go from "interpreter" mode to "compiler" mode :)...tx a ton – Rainmaker Jan 29 '16 at 0:04
  • 2
    @kvnfv I've done this, too. In fact, if I had a quarter for every time I'd misread something, I probably could have retired by now. – sfdcfox Jan 29 '16 at 0:06

As sfdcFox mentioned, there is not Standard SF Class called "OAuth2".

I guess you are talking about implementing OAuth2 in salesforce. There are various good examples provided by Salesforce. There is noting much to copy them here, so directly putting the link for your reference


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.