Skip to Content
0

Error in getting access token redirect url oAuth cross domain error

Dec 19, 2016 at 04:22 PM

258

avatar image

Hi, when we call try to get the access token using oAuth we ar being redirected to jam landing page inside the gadget.

when i open console i see the error. we have added cross domain setting in our application.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://fvpkgav5pfl1k2695pok2qn1r7dsc8ea-locked.gadgets-jam4.sapjam.com') does not match the recipient window's origin ('https://hcm4preview.sapsf.com').

10 |10000 characters needed characters left characters exceeded

If i open the application in new window it works and i get the access token.

error.png

However if i do the same in gadget itself. i am redirected to the jam landing page and not the redirect url. image attached.

error.png (64.1 kB)
error2.png (68.3 kB)
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Adam Stone
Jan 05, 2017 at 05:58 PM
0

It looks like you are trying to modify one of our tutorials to expand its functionality and are running into a cross origin issue as SAP Jam and the SuccessFactors login page are not on the same server. It also appears that you are trying to do authentication using three legged OAuth. I'm not sure how easy this would be, or why you would not just take advantage of the opensocial api's that will already have you authenticated. You will need to provide more details on what you are trying to modify and what your attempted workflow is for us to assist further on this.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

HI Adam thanks for your answer. I do not how how to get access token 1.0a from the iframe to call the oData apis, we are able to get the token using php oAuth client oAuth 1.0a and it redirects to allow or deny page. the same thing does not work in the iframe and we get redirected to the landing page. we have already written part of the code for authorize user by getting Auth 1.0a token, and then call the other APIs. We now need to function in the opensocial gadget and want it to be a seamless experience. How does user authorize an external application inside an ifame for oAuth 1.0a token.

0

I would highly suggest reading the documentation around gadget.io.makerequest.

http://help.sap.com/download/documentation/sapjam/developer/#53a65daf9b3848afa0beae037256f343.html

0

gadgetexample.txt HI Adam,

I implemented gadget.io.makerequest. and it gives me You have disallowed this request. error.png I get the same error when implementing oAuth 2.0 using php client. So i do not have the oAuth 2 access token.

error.png (58.4 kB)
0