Closed ThomasSHA closed 8 years ago
I would suggest that you create a new IAuthenticator
that returns null when login(...) is called, instead of prompting the user for and UI.
Here is an example that should work for MSA accounts, and modifying ADAL or the Disambiguation authenticators should follow a similar path.
final MSAAuthenticator silentOnlyMsaAuthenticator = new MSAAuthenticator() {
@Override
public String getClientId() {
return "000000000000000";
}
@Override
public String[] getScopes() {
return new String[] {"onedrive.appfolder", "wl.offline_access"};
}
@Override
public synchronized IAccountInfo login(String emailAddressHint) throws ClientException {
return null;
}
};
thx. this works too :)
What I want to achieve: When my App is opened I want to try a silent login. If that works, I can update stuff like free space etc.. BUT If it doesn't work, I want the SDK to do nothing (until the user explicitly wants to connect to onedrive).
Till now I haven't found a nice solution.
loginAndBuildClient
pops up the Login Dialog if silent login fails.What I did till now: I've overwritten the
OneDriveClient
and basically copied theloginAndBuildClient
but instead of callinglogin
whenloginSilent
fails I return theAccountInfo
(which is null in that case).This works for now. But maybe you got another little trick for me ;)