简体   繁体   中英

Android - how to get access token of one drive

Account account = new Account("xxxx@xxx.com", "com.microsoft.skydrive");

AccountManagerFuture accFut = AccountManager.get(this).
getAuthToken(account, "sh", null, this, null, null);

Bundle authTokenBundle = (Bundle) accFut.getResult();

String authToken = authTokenBundle.get(AccountManager.KEY_AUTHTOKEN).toString();

This code is not working. .

If you want to integrate your Android app with OneDrive, you can start with OneDrive Android SDK . Simply you can get an access token in your app by

oneDriveClient.getAuthenticator().getAccountInfo().getAccessToken();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM