Hi,

I am exchanging a SAML token with OAuth token using "getTokenResponse"
method [1] of Jaggery's "OAuth" module. This method will return
"AccessTokenResponse"
object. But "sendOAuthRequest" method expects a "Token" object. Hence, I am
manually creating "Token" object and passing it to "sendOAuthRequest"
method, as shown below. I am referring [2] to create a "Token" object
manually.






*        var accessTokenResponse =
oauthProvider.getTokenResponse(samlResp);        accessToken =
accessTokenResponse.getAccessToken();        var oauth2Token = {};
oauth2Token.token = accessToken;        oauth2Token.secret =
"PkxikDuusEi67VpuqK7gpsLJlYIa";        var response =
**oauthProvider.sendOAuthRequest(oauth2Token,
"GET", "https://xx.xx.xx.xx:8251/bpmn/1.0.0/repository/deployments
<https://xx.xx.xx.xx:8251/bpmn/1.0.0/repository/deployments>");*

But I am getting the following exception when executing this block. I think
this exception is thrown from here [3].

JavaException: org.jaggeryjs.scriptengine.exceptions.ScriptException:
Invalid Access Token

I think something is wrong with constructing the "Token" object. Any
pointers?

[1]
https://github.com/wso2/jaggery-extensions/blob/master/oauth/resources/org.jaggeryjs.modules.oauth/src/main/java/org/jaggeryjs/modules/oauth/OAuthHostObject.java#L211-L238
[2]
http://grepcode.com/file/repo1.maven.org/maven2/org.scribe/scribe/1.2.3/org/scribe/model/Token.java#Token.0token
[3]
https://github.com/wso2/jaggery-extensions/blob/master/oauth/resources/org.jaggeryjs.modules.oauth/src/main/java/org/jaggeryjs/modules/oauth/OAuthHostObject.java#L149

Thanks,
Raj.

-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to