signpost oauth with salesforce example

40 views
Skip to first unread message

danyy

unread,
Oct 18, 2011, 2:12:05 AM10/18/11
to Signpost users
in salesforce cant make api calls with token, so need to get session
id ..after getting access token we can login using session id.


// Poor man's XML parsing. We only care about these two values in the
response, so just using simple regex.
final Pattern loginResultPattern =
Pattern.compile(".*<serverUrl>(.*)</serverUrl>.*<sessionId>(.*)</
sessionId>.*");
final Matcher loginResultMatcher =
loginResultPattern.matcher(loginResult);
loginResultMatcher.matches();
final String serverUrl = loginResultMatcher.group(1);
final String sessionId = loginResultMatcher.group(2);

System.out.println("Server Url: " + serverUrl);
System.out.println("Session Id: " + sessionId);


in salesforce example ,to get session id but errors are dere..
Reply all
Reply to author
Forward
0 new messages