Box JWTOauth App User - 404 error

新規投稿

コメント

3件のコメント

  • kendomen

    Can you share your code?

    0
    コメントアクション パーマリンク
  • cgopalakrishna

    var session = new BoxJWTAuth(BoxConfig.CreateFromJsonFile(fs));

    var serviceAccountClient = session.AdminClient(session.AdminToken());

    // Use the GetCurrentUserInformationAsync method to retrieve current user's information.

    // Since this client uses the Service Account, this will return the Service Account's information.

    var serviceAccountUserInfo = await serviceAccountClient.UsersManager.GetCurrentUserInformationAsync();

    // Log the Service Account's login value which should contain "AutomationUser".

    // For example, ***email address removed for privacy***

    Console.WriteLine(serviceAccountUserInfo.Login);

    var adminToken = session.AdminToken();

    Console.WriteLine("Admin Token: " + adminToken);

    Console.WriteLine();

    var adminClient = session.AdminClient(adminToken);

    //var userRequest = new BoxUserRequest() { Name = "test appuser", IsPlatformAccessOnly = true };

    //var appUser = await adminClient.UsersManager.CreateEnterpriseUserAsync(userRequest);

    //adminClient.UsersManager.GetEnterpriseUsersAsync

     

     

    Console.WriteLine("Created App User");

    var userToken = session.UserToken("***number removed for privacy***4");

    var userClient = session.UserClient(userToken, "***number removed for privacy***4");

    var userDetails = await userClient.UsersManager.GetCurrentUserInformationAsync();

    Console.WriteLine("\nApp User Details:");

    Console.WriteLine("\tId: {0}", userDetails.Id);

    Console.WriteLine("\tName: {0}", userDetails.Name);

    Console.WriteLine("\tStatus: {0}", userDetails.Status);

    Console.WriteLine("\tLogin: {0}",userDetails.Login);

     

    0
    コメントアクション パーマリンク
  • cgopalakrishna

    I created user and then I had to grant permission to that user to the Box folder. And use the User ID to get user and then I was able to upload the file. Not sure if this is the right way to do. I was thinking the user created through app will automatically have access same as the app.

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。