Hi All,
I am using the refresh token for my web application and it works fine. However, the process of generating a refresh token offline that the user has to run the java app is not user friendly; the user has to run the app, clicks the output link, and then hits an Allow button; after that the user needs to copy the Authorization Code back to the program and enter is too much work. In addition, the users mostly are not developers so they do not have Java SDK or Maven to run the Java program. Is there anyway that I can provide the App key and the Secret Key and then generate the Refresh Key automatically? The following code is the one that I use to create a refresh key.
DbxAppInfo appInfo;
appInfo = DbxAppInfo.Reader.readFromFile(argAppInfoFile);
DbxAuthFinish authFinish = null;
authFinish = new PkceAuthorize().authorize(appInfo);
DbxCredential credential = new DbxCredential(authFinish.getAccessToken(),
authFinish.getExpiresAt(),
authFinish.getRefreshToken(),
appInfo.getKey(),
appInfo.getSecret());
File output = new File(argAuthFileOutput);
try {
DbxCredential.Writer.writeToFile(credential, output);
}
catch (IOException ex) {
return;
}