How to use the SDK with an "App Token" (Server Authentication)?
See original GitHub issueWe’re writing an app that needs to be able to upload files to Box so that we can use the “New Box View” preview functionality. I’ve created an app in the Box dev console, and specified “App Token (Server Authentication)” as the authentication type, as specified by the migration docs.
Looking at the SDK readme for .NET and I’m having a heck of a time trying to decipher how the “App Token” style of authentication jives with what’s in the readme. In the readme I see terminology like “Client Id”, “Client Secret”, “Developer Token,” etc. But in the new app I’ve created, the terminology is “API Key”, “Primary Access Token”, “Secondary Access Token” (which I understand is just a fallback that works like the primary).
So when I see this example of how to setup a client, I don’t really understand how to utilize the key/token that has been generated:
var config = new BoxConfig(<Client_Id>, <Client_Secret>, new Uri("http://localhost"));
var session = new OAuthSession(<Developer_Token>, "NOT_NEEDED", 3600, "bearer");
client = new BoxClient(config, session);
Does anyone have an example of how to use the SDK with the App Token (Server Authentication)?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hey @winzig — the example linked is for JWT Auth, not the App Token Auth your app is using. In order to use the App Token you have, you’d want to do something like this:
Can you give that a try and see if it works for you?
@winzig Great, I’m glad it’s working for you! 🎉 We’ll add some documentation to help clarify how to use the different auth models.