How to using primary key or secondary key to connect.
i can get access token and refresh token, but that one have expires time use. In document, i saw primary token or secondary token can you without exprires. I read code in github have a function to connect using that key, but that is old version, have no API key for now and have no method to using API key and secondary key on Box.V2. So somebody know about that ?
-
Hi ,
Great question. I would suggest avoiding using "Primary" or "Secondary" tokens for most use cases. To connect to Box's API, you'll need to follow one of our documented Authentication Types:
https://developer.box.com/docs/authentication-types-and-security
All of our SDKs support both methods:
https://developer.box.com/docs/sdks
The reason I do not suggest using "Primary" or "Secondary" tokens are because they are specific to one authentication type (https://developer.box.com/docs/box-view), is very limited in scope, and cannot use any of Box's most commonly used API endpoints. A lot of developers just see that it "doesn't expire", but it's important to consider the scope limitations too.
Hope that helps!
-
I'm really happy when you reply, i understood, but can you tell me thats token (primary and secondary) can working or not and if it working how can i use in case i want to use. Because, i'm reseaching this method to use for my project which is i'm developing. So i need that token to built an automatic system and it must have no expired.
Currenly, I'm using accesstoken and refresh token, but it expired after 60 minute. This case how to automatic get refresh token again by code ?
Please reply my !
Thank you
-
Hi ,
There are two main methods you can use, which are described here:
https://developer.box.com/docs/authentication-types-and-security
All of our SDKs will do it automatically for you. There are some other forum posts you can search for on the same topic to help you decide. Here's the one I usually use:
Hope that helps!
Thanks,
Jason
Please sign in to leave a comment.
Comments
3 comments