Dec 24th, 2011, 08:09 AM
New Extension: Spring Social Salesforce
I started a new project Spring Social Salesforce, the source code is on Github: https://github.com/umut/spring-social-salesforce
It does not yet cover the whole Salesforce API especially the Chatter and it is not tested thoroughly in production. Luckily in my current company we are also using the same extension to integrate an internal application with Salesforce and it will get more mature in the coming weeks.
Below is the list of supported operations.
- Retrieve all available api versions
- Retrieve services supported by a specific version of the api
- Retrieve the list of sObject's
- Retrieve summary-metadata of an sObject
- Retrieve full-metadata of an sObject
- Retrieve a row from an sObject
- Retrieve a blob from a row in an sObject
- Retrieve recent changes feed
- Execute a SOSL search and retrieve the results
- Run a SOQL query and retrieve the results
- Retrieve user profile
- Retrieve user status
- Update user status
Any feedback is appreciated.
Feb 1st, 2012, 12:22 AM
I have a requirement, please help!!!
We have a intranet Application that uses Exchange Server credentials for authentication. We also have a internal social networking platform hosted in SalesForce.com. There is no SSO between both the application. Only match could be the User name between both the application could be same. Now I need to do an integration from my intranet application to SalesForce.com using Chatter REST API or anything to post the feeds to SalesForce.com. The more interesting part is, it should not ask user to prompt to enter a UID/PWD credentials while posting the feed from the intranet application. The only way I am thinking is to query the SalesForce user name and impersonate as that user. I would like to know this can be achieved or do you have any other option to do it??
Please provide your feedback??
Feb 2nd, 2012, 03:15 AM
Sorry for the late reply.
Basically you have two ways to impersonate a user on Salesforce; w/ knowing the credentials.
If you know the credentials you can do a client login. But while doing client login, you also need to provide a security token per user. This is a extra level of security required by Salesforce. It is one more thing for you to know besides the password and this is also something that can be changed by the user from time to time just like password.
If you don't know the credentials, you can use OAuth and get an access token when the user authorizes your application after a successful login to Salesforce. What I understood from your post is that you don't want to make users login to Salesforce. Unfortunately with OAuth you at least make them login once and have them grant you access and get an access token. After that point you can just use the access token whenever you need to impersonate that user without logging in.
For the first option unfortunately I am not sure whether you can query Salesforce (possibly with an sandbox admin credentials) and get password and security token. Even if you get them, they will most likely be encrypted and may not help you in this case.
I think OAuth option is the best fit for your use case. Whenever a user tries to post an update to Salesforce for the first time, you redirect them to Salesforce login page and get an access token. You can use that access token to post as many updates as you want later.
However there is one tiny problem that Salesforce requires you to refresh access tokens from time to time and this is not something yet supported by Spring Social. You either have to handle those cases manually or you wait for this feature to be implemented by Spring Social team. There is a related issue on this; SOCIAL-263 and according to Spring Social team it is planned for 1.1.0 version.
I hope it clarifies the matter for you. If you need further help, don't hesitate to contact via email.
Feb 9th, 2013, 01:42 AM
SalesforceFactory factory = new BaseSalesforceFactory(clientid, clientSecret);
Salesforce template = factory.create(username, password, secretToken);
I saw this in one of your examples. But Once I authenticate How do I attach it to my RestTemplate to make a call to Custom SalesForceEndPoint.