Skip to content

Instantly share code, notes, and snippets.

@junojisan
Last active March 20, 2021 16:07
Show Gist options
  • Save junojisan/8da473e2bf5af42249ba to your computer and use it in GitHub Desktop.
Save junojisan/8da473e2bf5af42249ba to your computer and use it in GitHub Desktop.
public PageReference initiate(){
String authorizeUrl =
'https://login.salesforce.com/services/oauth2/authorize';
authorizeUrl += '?response_type=code';
authorizeUrl += '&client_id=' + CLIENT_ID;
authorizeUrl += '&redirect_uri=' + CALLBACK_URL;
authorizeUrl += '&prompt=login consent';
PageReference pref = new PageReference(authorizeUrl);
pref.setRedirect(true);
return pref;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment