-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get BoxSession by AccessToken or RefreshToken #415
Comments
Any voice here? |
Hi @ohs0612 , |
Hello @PJSimon , However, now, I am trying to sort how to refresh accessToken out. I am trying to use the solutions, mentioned from this link: But, the debug mode points out my app stops at this line: And when I click pause, it seems like it keeps waiting at the stack trace here: (Object.java) I still keep getting the "401 unauthorized error" back, and none of the logs from BoxAuthentication.AuthListener() callbacks has been print out. Below is my code snippet:
} Hope you can get well with the development of iOS sdk; I would be much appreciated if you or your team have some little time to help me or light me even just a little bit. Oliver |
Hi @ohs0612 , In your Does this help you any? |
Hello Nidoran, mBoxSession = mBoxSession.refresh().get(); would do that, but maybe I am wrong? Yes, of course, it helps me clarifying my concepts a lot! Thank you!! |
Yes, you will need to generate a new valid access token by yourself in |
OK, I see; I'll modify my program into that way! |
Description of the Issue
Hi, I am wondering how can we achieve BoxSession by only AccessToken or RefreshToken or both tokens? Like this post (#18) said, we have previously managed our authentication process, so we want to skip the default authentication process.
I have found out that there is a constructor for BoxSession like this:
/**
* This is a convenience constructor. It is the equivalent of calling BoxSession(context, authInfo, refreshProvider) and creating an authInfo with just
* an accessToken.
*
* @param context current context
* @param accessToken a valid accessToken.
* @param refreshProvider the refresh provider to use when the access token expires and needs to refreshed.
* @param an instanceof of a refresh provider that is serializable.
*/
public <E extends BoxAuthentication.AuthenticationRefreshProvider & Serializable> BoxSession(Context context, String accessToken, E refreshProvider) {
this(context, createSimpleBoxAuthenticationInfo(accessToken), refreshProvider);
}
But I am confused about what does the "refreshProvider" means? And how to correctly get the BoxSession?
Is there any sample to doing so?
I do appreciate it in advance.
Versions Used
Box Content SDK: implementation 'com.box:box-android-sdk:5.0.0'
Android: Android Studio 3.5.1
The text was updated successfully, but these errors were encountered: