Skip to main content
Question

Can't Create App Users with Java SDK

  • May 21, 2025
  • 4 replies
  • 27 views

Forum|alt.badge.img

Using the following code with an application that has the rights to create app users:

 

BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(
ENTERPRISE_ID, CLIENT_ID, CLIENT_SECRET, encryptionPref, accessTokenCache);


BoxUser.Info user = BoxUser.createAppUser(api, APP_USER_NAME);

 

getIsPlatformAccessOnly always returns false, even if I pass in params.  Instead, it's creating an enterprise user I can login as, which the application is not technically authorized to do.

 

This is with a developer account.  Anyone else have this issue or can tell me what I'm doing wrong?

4 replies

Forum|alt.badge.img

Could you please try this :

 

CreateUserParams userParams = new CreateUserParams();

userParams.setIsPlatformAccessOnly(true);

BoxUser.Info userInfo = BoxUser.createAppUser(api,APP_USER_NAME,userParams);

 

Hope this will help.

 


Forum|alt.badge.img

Thanks for the reply.

 

I've tried to specifically setIsPlatformAccessOnly to true and I also tried it with multiple app user names.

 

All fail with the same error code when trying to login as app user.

 

thanks.


Forum|alt.badge.img

Ok, I think I see what's happening.  I guess you have to call it like this...

 

BoxUser user = new BoxUser(api, "***number removed for privacy***");

// logical way
System.out.println(user.getInfo().getIsPlatformAccessOnly());

// I guess you have to specifiy it        
System.out.println("getIsPlatformAccessOnly: " + user.getInfo("is_platform_access_only").getIsPlatformAccessOnly());

 

 


Forum|alt.badge.img

here's through postman...

BOX_17ys9mjavu0d98fqnkkg9ek58j5q6f2q.png