{"error":"invalid_grant","error_description":"Please check the 'sub' claim. The 'sub' specified is i
Hi
I am trying to make BOX Connection using App User that I created using enterprise user and I am getting below error
{"error":"invalid_grant","error_description":"Please check the 'sub' claim. The 'sub' specified is invalid."}
Basically below my code snippet
1.Created enterprise api connection as below
BoxDeveloperEditionAPIConnection api =
BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(boxConfig, accessTokenCache);
2.Created App user as below
String userName = "appuser1";
String jobTitle = "App User 1";
long spaceAmount = ***number removed for privacy***4;
// Create app user
BoxUser.Info createdUserInfo = BoxUser.createAppUser(api, userName);
System.out.println(" App user ID " +createdUserInfo.getID());
3.Now when I am trying to make api connection using user id created in step 2 above , I am getting error mentioned above
Below is the connection code
String userId = "***number removed for privacy***";
BoxDeveloperEditionAPIConnection session = new BoxDeveloperEditionAPIConnection(userId, DeveloperEditionEntityType.USER, boxConfig, accessTokenCache);
String userToken = session.getAccessToken();
System.out.println("userToken"+userToken);
Can somebody please tell me the reason
Please sign in to leave a comment.
Comments
1 comment