I have gone through the threads, also i have refresh the build and made sure the request and SHA256value is generated using the right key . my call back function is @RequestMapping(path = "login/kite/callback", produces = "application/json; charset=UTF-8",method = RequestMethod.GET) @Override public void loginCallBack(@RequestParam("request_token")String access_token) { System.out.println("call back obtained:"+access_token); KiteConnect kiteConnect = new KiteConnect("XXXXX"); try { User user = kiteConnect.generateSession(access_token,"XXXXXX"); kiteConnect.setAccessToken(user.accessToken); kiteConnect.setPublicToken(user.publicToken); } catch (KiteException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
I am getting the request_token and When I call the generate session I ma getting the issue of Token exception. Attached is the error log.
com.zerodhatech.kiteconnect.kitehttp.exceptions.TokenException at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:48) at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:20) at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:85) at com.zerodhatech.kiteconnect.KiteConnect.generateSession(KiteConnect.java:189) at com.trade.algo.login.KiteLogin.loginCallBack(KiteLogin.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)