Authentication with box-node-sdk




  • rbratton

    Hi Cam!


    I may be totally misreading what you are trying to accomplish, but in our application we are using the Service Account to deal with all our Box content.  I think if you need the Enterprise token, the following may not apply to you.  I'm using the .NET SDK.


    All I do to get a BoxClient I can use to upload files and get shared links is the following:


                // Initialize the SDK with the Box token data and create a client that uses the Service Account.
                var session = new BoxJWTAuth(BoxConfig.CreateFromJsonString(accessTokenData));
                return session.AdminClient(session.AdminToken());

    The accessTokenData is the text inside the JSON JWT token file you should have downloaded from your Box Developer account when you created your app.  I save the returned BoxClient instance and use it elsewhere in my class to use Box services.


    I didn't see the info about creating a "pre-configured" SDK instance, so I'm not doing it, but the above works for me.


    Hope this helps!


    コメントアクション Permalink
  • Howard

    Thanks  for your help with this post!


      did this solve your question? If so, give props and tell the community by clicking the Accept Solution button beneath  post!


    Thanks for your time in the community and appreciate your help in the community

    コメントアクション Permalink