Create a configuration object. (.NET)
Hi!
Could someone provide the complete code for this step?
This is the code from the website, if someone could complete that with class name and if I need to link the another class that would be appreciated. Also where do I find this "YOUR CONFIG JSON FILE PATH", is it on my local computer or on box:
using System;
using System.ComponentModel;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Box.V2.Config;
using Box.V2.JWTAuth;
using Box.V2.Models;
// Read in config file
IBoxConfig config = null;
using (FileStream fs = new FileStream("YOUR CONFIG JSON FILE PATH", FileMode.Open))
{
config = BoxConfig.CreateFromJsonFile(fs);
}
// Create JWT auth using config file
var boxJWT = new BoxJWTAuth(config);
-
There's some documentation for how to set up the SDK at https://github.com/box/box-windows-sdk-v2/blob/master/docs/authentication.md#server-auth-with-jwt — does that answer your question? The JSON file referred to here is the one you can download from the Box Developer Console for your application, and it is expected that the file is available in your application, usually on disk.
Please sign in to leave a comment.
Comments
1 comment