failure Smugmug login for android: error code 36
parkypark86
Registered Users Posts: 4 Beginner grinner
The android app I have developed has to login to Smugmug account. So I generate Smugmug api-key and secret key with my project name.
But when I login on the phone, it gave me error message on the web. It says Smugmug doesn't recognize this applications credentials.
I know what that means. But there is nothing wrong on my key and secret key.
I hope anyone can fix my problem.
and My Error message on the broswer :
SmugMug doesn't recognize this application's credentials
Error message on the console (on my eclipse)
{"stat":"fail","method":"smugmug.auth.getAccessToken","code":36,"message":"invalid/expired token"}
there is my servlet to acquire requestToken and display login page.
protected void doPost(HttpServletRequest request, HttpServletResponse responseHttpServlet) throws ServletException, IOException {
SmugMugAPI smugmug = new SmugMugAPI(APP_NAME, API_SECRET, API_KEY);
try {
//this code supposed to give requestToken and give authorized url.
String url = smugmug.auth().getAuthorizeUrl(false, Permission.READ);
//here I give url to the android so that android can display the web.
//I actually not sure if I can do it.
PrintWriter out = responseHttpServlet.getWriter();
out.println(url);
Auth auth = smugmug.auth().getAccessToken();
String userId = auth.getToken().getId();
String accessToken = auth.getToken().getSecret();
out.println("userId " + userId);
out.println("accessToken " + accessToken);
//responseHttpServlet.getOutputStream().print(accessToken);
out.close();
} catch (SmugMugException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
But when I login on the phone, it gave me error message on the web. It says Smugmug doesn't recognize this applications credentials.
I know what that means. But there is nothing wrong on my key and secret key.
I hope anyone can fix my problem.
and My Error message on the broswer :
SmugMug doesn't recognize this application's credentials
Error message on the console (on my eclipse)
{"stat":"fail","method":"smugmug.auth.getAccessToken","code":36,"message":"invalid/expired token"}
there is my servlet to acquire requestToken and display login page.
protected void doPost(HttpServletRequest request, HttpServletResponse responseHttpServlet) throws ServletException, IOException {
SmugMugAPI smugmug = new SmugMugAPI(APP_NAME, API_SECRET, API_KEY);
try {
//this code supposed to give requestToken and give authorized url.
String url = smugmug.auth().getAuthorizeUrl(false, Permission.READ);
//here I give url to the android so that android can display the web.
//I actually not sure if I can do it.
PrintWriter out = responseHttpServlet.getWriter();
out.println(url);
Auth auth = smugmug.auth().getAccessToken();
String userId = auth.getToken().getId();
String accessToken = auth.getToken().getSecret();
out.println("userId " + userId);
out.println("accessToken " + accessToken);
//responseHttpServlet.getOutputStream().print(accessToken);
out.close();
} catch (SmugMugException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
0