oAuth 2.0 Implementation

oAuth 2.0 Implementation

  
Hi,

I will be configuring an intergration that uses oAuth 2.0. Any hints on how am I going to implement this?

I was able to call the REST web service but it doesn't go through because the authentication is not supplied.

(found a same topic but it was over year and the component is for OS v8)

Regards,
JC
JC, Many open source forge extension use Oauth 2.0 to consume various web service; Please see Facebook connector, twitter connector for a good example on how to implement Oauth. http://www.outsystems.com/forge/


Hi Robert,

I have already tried doing it but I am still gettting nowhere. I followed the pattern used in the Dropbox Connector but even in the first step of authentication, I am already getting 'Internal Server Error'. This is where I am building the URL to redirect my app for authentication. Upon going to the authentication site, then I get the error in the browser. I checked the OS error logs and there is nothing pertaining to it.

By the way, the application in question is Sage One.

Regards,
JC
JC

Stage One

This is how you create a Stage One connector

1) Add a web screen with input parameter “code” and “country” (You need this for step 2 below)

Add access_token and refresh_token, scope, expires_in  (you need this in step 3)

Example 

You added a web screen titled “callback”

It should be accessible via https://domain.com/stageoneconnector/callback.aspx 

2) Redirect the user to https://www.sageone.com/oauth2/auth

https://www.sageone.com/oauth2/auth?response_type=code&client_id=123456789&redirect_uri=https://domain.com/stageoneconnector/callback.aspx&scope=full_access

 

When user authorise your application, stage one returns the user’s authorization “code” and “country” code via the callback web screen

 

3) Do a http POST via https://api.sageone.com/oauth2/token passing the authorization code (you retrieved in step 2)

 

Pass client_id, client_secret, code, grant_type=authorization_code and your call back redirect_uri

 

Stage one will response back with the access_token and refresh_token, scope, expires_in 

 

All Done. You can now start using the access token to make web service calls on behalf of the user.


Hi Robert,

2) Redirect the user to https://www.sageone.com/oauth2/auth

https://www.sageone.com/oauth2/auth?response_type=code&client_id=123456789&redirect_uri=https://domain.com/stageoneconnector/callback.aspx&scope=full_access

When user authorise your application, stage one returns the user’s authorization “code” and “country” code via the callback web screen

==

Based on the video tutorial on API, after redirecting to the authentication URL, I should be asked for my Sage One credentials (login page). Instead, it goes to the 'Internal Server Error'. That it why I can't move on to the further steps.

My URL: https://www.sageone.com/oauth2/auth?response_type=code&client_id=7ea6d5c3xxxxxxx468b&redirect_uri=https%3a%2f%2fdomain.com.au%2fSageOneConnector%2fSageOneCallBack.aspx&state=9b199abc-5ab2-4fc7-9316-12cafe86f345&scope=full_access

note: SageOneCallBack is the name of my screen.

Regards,
Check your "client_id" and "redirect_uri" values, if they are both valid, please contact stage one technical support for further assistance.