I have a web application developed in .net framework. I am trying to implement Oauth in sugarCRM in order to integrate it with my applications.
The Oauth mechanism given by sugarCRM is using PHP Click Here…
where as, my application is designed in ASP.
I am trying to figure out solution (like converting php code to asp or implementing the same mechanism in my application) for same but got no solution.any help would be appreciated.
after much pain, I’ve got my .Net Code working on SugarCRM…..
This is what I did….all in a Console app for me. This a proof of concept and so everthing is hard coded for now!
Use Nuget to Install OAuth by Daniel Crenna
Step 1: Establish Consumer Key
Go into Admin -> OAuth Keys section on SugarCRM and create a new record, I used Key & Secret.
Step 2: Creating a Request Token
This is the tricky part that took me ages to figure out, notice the requesturl is without the query part in the client, and you have add it to the GetAuthorizationQuery call AND to the actual WebRequest url.
Note down the 3 items ready for Step 4.
Step 3 Approve Request Token
Visit the url “authorize_url” above and also add &token= “oauth_token”. For this was:
Authorise the token and record the Token Authorisation Code.
Step 4 Request Access Token
Token and TokenSecret are from Step 2, Verifier is the Auth Code from Step 3.
Step 5 Use the Access Token
I’m just using the session id as Recommended by the Documentation, so to get the sessionId
Here I’m using JSON.Net to parse the Json into a dynamic object for easy access to the id.
Step 6 Make it do something….
Over to you!
Pretty painful experience, but at least its working for me…..
Tim