如果不应该,eBay FetchToken会返回错误的SecretID失败

时间:2012-03-15 11:48:52

标签: authentication token ebay

我需要从易趣中检索用户令牌。

我为我开发的Android应用程序完成了所有必要的步骤 - 使用ebay注册,获取app id,dev id和app certificate。

我可以成功获取会话ID,让用户在eBay身份验证页面上按下“我同意”时进行身份验证。

然而,检索用户令牌的最后一步失败,错误代码为16117 - SecretID无效。

eBay的开发者指南指出,如果存在有效的SessionID,则不需要SecretID。

任何人都可以提示我可能出现的错误吗?

感谢。

下面是XML结构的日志(显然所有前面的步骤都正确完成,数据也是正确的)我发送给ebay,以及失败的XML响应。

 03-15 22:40:04.555: INFO/OUT(16905): SESSION ID = pWcBAA**16253a261360a03347979c97fffff5f2
 03-15 22:40:04.560: INFO/OUT(16905): XML REQUEST BODY = <?xml versio="1.0" encoding="utf-8"?>
 03-15 22:40:04.560: INFO/OUT(16905): <FetchTokenRequest xmlns="urn:ebay:apis:eBLBaseComponents">
 03-15 22:40:04.560: INFO/OUT(16905): <SessionID>pWcBAA**16253a261360a03347979c97fffff5f2</SessionID>
 03-15 22:40:04.560: INFO/OUT(16905): <Version>763</Version>
 03-15 22:40:04.560: INFO/OUT(16905): <WarningLevel>Low</WarningLevel>
 03-15 22:40:04.560: INFO/OUT(16905): </FetchTokenRequest>


 03-15 22:40:05.075: INFO/OUT(16905): <FetchTokenResponse>
 03-15 22:40:05.075: INFO/OUT(16905):     <Timestamp>
 03-15 22:40:05.080: INFO/OUT(16905):         2012-03-15T11:38:34.605Z
 03-15 22:40:05.080: INFO/OUT(16905):     </Timestamp>
 03-15 22:40:05.080: INFO/OUT(16905):     <Ack>
 03-15 22:40:05.080: INFO/OUT(16905):         Failure
 03-15 22:40:05.080: INFO/OUT(16905):     </Ack>
 03-15 22:40:05.080: INFO/OUT(16905):     <Errors>
 03-15 22:40:05.080: INFO/OUT(16905):         <ShortMessage>
 03-15 22:40:05.080: INFO/OUT(16905):             The secret Id is invalid.
 03-15 22:40:05.080: INFO/OUT(16905):         </ShortMessage>
 03-15 22:40:05.080: INFO/OUT(16905):         <LongMessage>
 03-15 22:40:05.080: INFO/OUT(16905):             The secret Id you provided does not match with the one you provided earlier.
 03-15 22:40:05.080: INFO/OUT(16905):         </LongMessage>
 03-15 22:40:05.080: INFO/OUT(16905):         <ErrorCode>
 03-15 22:40:05.080: INFO/OUT(16905):             16117
 03-15 22:40:05.080: INFO/OUT(16905):         </ErrorCode>
 03-15 22:40:05.080: INFO/OUT(16905):         <SeverityCode>
 03-15 22:40:05.080: INFO/OUT(16905):             Error
 03-15 22:40:05.080: INFO/OUT(16905):         </SeverityCode>
 03-15 22:40:05.080: INFO/OUT(16905):         <ErrorClassification>
 03-15 22:40:05.080: INFO/OUT(16905):             RequestError
 03-15 22:40:05.080: INFO/OUT(16905):         </ErrorClassification>
 03-15 22:40:05.080: INFO/OUT(16905):     </Errors>
 03-15 22:40:05.080: INFO/OUT(16905):     <Version>
 03-15 22:40:05.080: INFO/OUT(16905):         765
 03-15 22:40:05.080: INFO/OUT(16905):     </Version>
 03-15 22:40:05.080: INFO/OUT(16905):     <Build>
 03-15 22:40:05.080: INFO/OUT(16905):         E765_INTL_BUNDLED_14580691_R1
 03-15 22:40:05.080: INFO/OUT(16905):     </Build>
 03-15 22:40:05.080: INFO/OUT(16905): </FetchTokenResponse>

1 个答案:

答案 0 :(得分:0)

好吧,我找到了原因。指定标识值时,请确保没有任何前导或尾随空格,例如换行符。换句话说:

    <SecretId>SOME_ID</SecretID>    is correct

    <SecretID>
         SOME_ID
    </SecretID>                   is not correct

希望这对有类似问题的其他人有帮助。