2016-08-01 6 views
0

내가 Flipkart 판매자 API와 등록 된 플립 카트 판매자 API에 액세스하려고 - 개발자 관리 포털을 문서에 주어진 단계를 수행하여 : -Flipkart 판매자 API 액세스 토큰 생성 문제

https://seller.flipkart.com/api-docs/FMSAPI.html

Flipkart에 성공적으로 등록한 후 액세스 토큰을 생성하는 데 사용되는 첫 번째 API가 작동하지만 내 코드를 통해이 API를 누르면 로그인 페이지 html이 응답으로 반환됩니다. 또한 단계에 따라 우편 배달부를 통해이 공격을 시도 : -

1)Type of request i tried with both (GET,POST) 
2)Set appid and app-secret in the header 
3)Use the following url:- 
https://api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api 

다음 응답이 내가 얻을 : - 나는 또한 샌드 박스가 제공하는 URL하지만 두 경우 모두에 동일한 응답과 노력

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
     <title>Flipkart</title> 
     <link type="text/css" rel="stylesheet" 
    href="./style.css" /> 
     <link type="text/css" rel="stylesheet" 
     href="./bootstrap.css" /> 
    </head> 
    <body> 
     <div class="navbar navbar-default navbar-static-top" role="navigation"> 
      <div class="container"> 
       <div class="navbar-header"> 
        <a class="navbar-brand" href="#">Flipkart Permission Registration</a> 
       </div> 
      </div> 
     </div> 
     <div class="container"> 
      <form id="loginForm" name="loginForm" role="form" class="form-signin" action="login.do" method="post"> 
       <h2 class="form-signin-heading">Please sign in </h2> 
       <input type="email" class="form-control" placeholder="Email address" 
      name='j_username' required="" autofocus=""> 
       <input type="password" name='j_password' class="form-control" 
      placeholder="Password" required=""> 
       <button class="btn btn-lg btn-primary btn-block" type="submit" name="login">Sign in</button> 
       <input type="hidden" name="CSRFToken" value="987f582b-9a4e-4c6c-a14b-681f2b57ca34"></input> 
      </form> 
     </div> 
    </body> 
</html> 

.

나는 당신이 좋아하는 URL을 변경해야 할 곳 발견이 문제를 구글로 -

https://api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api 

내가이 함께 시도했지만이 같은 응답을 반환됩니다 : -

{ 
    "error": "unauthorized", 
    "error_description": "An Authentication object was not found in the SecurityContext" 
} 

그래서 결국 flipkart 판매자 API에 대한 액세스 토큰을 얻을 수 없습니다. 제발 도와주세요 도움을 주시면 감사하겠습니다. 고마워요!

+0

헤더에 appid와 app-secret을 설정하고 있습니까? – TheGeorgeous

답변

0

당신은 당신의 flipkart APPID에 APPID를 대체하여 브라우저에서 다음 URL을 사용 AUTHCODE를 얻을 수 있습니다 : 당신이 AUTHCODE을 일단 https://api.flipkart.net/oauth-service/oauth/authorize?client_id=appId&grant_type=authorization_code&response_type=code&scope=Seller_Api&state=1234

은 curl 명령을 사용하여 당신이 APPID, appSecretKey 및 AUTHCODE를 제공하여 액세스 토큰을 얻을 수 있습니다 : curl -u appId : appSecretKey https://api.flipkart.net/oauth-service/oauth/token \ grant_type = authorization_code \ & state = 1234 \ & 코드 = authCode