Box.V2.JWTAuth.BoxJWTAuth.GetToken throws NullReferenceException (.NET)

New post



  • jcleblanc

    Hi ,


    Off hand I don't see anything anything directly wrong with the code, as this is what I'm using for my C# code:


    // Configure Box SDK instance
    var reader = new StreamReader("config.json");
    var json = reader.ReadToEnd();
    var config = BoxConfig.CreateFromJsonString(json);
    var sdk = new BoxJWTAuth(config);
    var token = sdk.AdminToken();
    BoxClient client = sdk.AdminClient(token);


    The one thing that I can say is it might be worth making sure that the content of your .json file is correct (should be directly downloaded from the Box app and not modified in any way) and that it's actually being read in correctly.

    Comment actions Permalink
  • ronnysh

    Thanks, I figured it out - the app needed to be submitted for authorization.

    Comment actions Permalink

Please sign in to leave a comment.