Authentication on behalf of User
Facing issues while authnicating on behalf of user. How would we get service account user token to do behalf of user authenication using JWT?
-
Here's an example
BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection( ENTERPRISE_ID, CLIENT_ID, CLIENT_SECRET, encryptionPref, accessTokenCache); Iterable managedUsers = BoxUser.getAllEnterpriseUsers(api, "***email address removed for privacy***"); for (BoxUser.Info managedUser : managedUsers) { System.out.println(managedUser.getName() + " " + managedUser.getStatus()); if (managedUser.getStatus().equals(BoxUser.Status.ACTIVE)) { // Used to get AppUser or ManagedUser BoxDeveloperEditionAPIConnection userApi = BoxDeveloperEditionAPIConnection.getAppUserConnection(managedUser.getID(), CLIENT_ID, CLIENT_SECRET, encryptionPref, accessTokenCache); BoxItem.Info boxItem = BoxFolder.getSharedItem(api, "https://hpdnyc.app.box.com/s/zjq4iwixgn44gvqt43ou4jmiqfehemkc"); BoxFolder publicFolder = (BoxFolder)boxItem.getResource(); Iterable items = publicFolder.getChildren(); for (BoxItem.Info item : items) { System.out.println("\t" + item.getName()); } } }
サインインしてコメントを残してください。
コメント
4件のコメント