question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ asked ·

signinRedirect sample does not work

I am using ebay java sdk Version 775 - Point Release , I am trying out the signinRedirect sample.  Each time I click "Go to signin..." button, instead directing me to signin page, it always directs me to sign out page: ("You've signed out. See you again soon!"). Looks like it has something to do with the session id get back from the call into sdk lib. If I substitute the session id with another session id generated directly from http call (instead of going through sdk), then it directs me to the signin page correctly. Can someone help me out here? Thanks a lot!

 

Below is the relevant config in authtool.properties

 

 

sandboxSignInUrl=https://signin.sandbox.ebay.com/ws/eBayISAPI.dll?SignIn

sandboxAPIUrl=https://api.sandbox.ebay.com/wsapi

 

 

ebaySignInUrl=https://signin.ebay.com/ws/eBayISAPI.dll?SignIn

ebayAPIUrl=https://api.ebay.com/wsapi

 

 

Below is the code of interest from the sample. I have verified the apiServerUri points to sandbox https://api.sandbox.ebay.com/wsapi, and signin url points to sandbox too https://signin.sandbox.ebay.com/ws/eBayISAPI.dll?SignIn

 

ApiContext apiContext = Global.createApiContext(devId, appId, certId, ApiServerUrl );

ApiLogging apiLogging = new ApiLogging();

apiContext.setApiLogging(apiLogging);

session.setAttribute("apicontext", apiContext );

 

GetSessionIDCall api = new GetSessionIDCall(apiContext);

api.setRuName(runame);

 

String ruParams="params="+runame +"-"+(environment==1?"Sandbox":"Production");

 

try {

 

String sessionID = api.getSessionID();

//sessionID = "%2BNUBAA**16a10a2e1380a471da212d01fffffebd";

session.setAttribute("sessionID", sessionID);

 

response.sendRedirect(response.encodeRedirectURL(signInURL + "&RuName=" + runame + "&SessID=" + sessionID + "&ruparams=" + ruParams));     

 

 

trading-sdk
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
zhuowei.developersupport@ebay.com avatar image
0 Likes"
zhuowei.developersupport@ebay.com answered ·

Hi wangy193112012,

 

  It's a bug.

  The SessionID obtained from GetSessionID API call needs to be urlencoded before passing it to the signin URL,  as below:

String sessionID = api.getSessionID();

String encodedSesssionIDString =URLEncoder.encode(sessionID,"UTF-8");
             response.sendRedirect(response.encodeRedirectURL(signInURL + "&RuName=" + runame + "&SessID=" + encodedSesssionIDString + "&ruparams=" + ruParams));
            
  I have opened an internal bug for the issue.

 

Thank you for reporting the issue.

Best Regards,

 

 

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.