You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that the [SDK documentation][sdk-docs] doesn't solve my issue.
I have checked that the [API documentation][api-docs] doesn't solve my issue.
I have searched the [Box Developer Forums][dev-forums] and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
I have searched [Issues in this repo][github-repo] and my issue isn't already reported.
Description of the Issue
I have started to migrate a BoxNodeSDK app to the BoxTSSDK.
My app is an Box Web Integration with an OAuth2 Authentication.
When I use the function await oauth.getTokensAuthorizationCodeGrant('code');, the Box TS SDK throw :
node_modules/box-typescript-sdk-gen/lib/schemas/fileOrFolderScope.generated.js:55
throw new errors_js_1.BoxSdkError({
^
BoxSdkError: Can't deserialize FileOrFolderScopeScopeField
at deserializeFileOrFolderScopeScopeField (node_modules/box-typescript-sdk-gen/lib/schemas/fileOrFolderScope.generated.js:55:11)
Steps to Reproduce
I open my Box Integration App from a Box folder
The app start correctly the OAuth2 Authentication process
The BoxNodeSDK crashed when I use oauth.getTokensAuthorizationCodeGrant('correct_code');
Error Message, Including Stack Trace
BoxSdkError: Can't deserialize FileOrFolderScopeScopeField
at deserializeFileOrFolderScopeScopeField (node_modules/box-typescript-sdk-gen/lib/schemas/fileOrFolderScope.generated.js:55:11)
at deserializeFileOrFolderScope (node_modules/box-typescript-sdk-gen/lib/schemas/fileOrFolderScope.generated.js:77:11)
at node_modules/box-typescript-sdk-gen/lib/schemas/accessToken.generated.js:84:90
at Array.map (<anonymous>)
at deserializeAccessToken node_modules/box-typescript-sdk-gen/lib/schemas/accessToken.generated.js:83:33)
at AuthorizationManager.<anonymous> (node_modules/box-typescript-sdk-gen/lib/managers/authorization.generated.js:210:106)
at Generator.next (<anonymous>)
at fulfilled (node_modules/box-typescript-sdk-gen/lib/managers/authorization.generated.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Patch
I have investigate on my side and it's look like that the scope 'item_read' is missing inside the deserializeFileOrFolderScopeScopeField() loop.
Hello,
Looks like the scope you are receiving is missing from the spec https://developer.box.com/reference/resources/access-token/#param-restricted_to-scope. This SDK is generated based on spec and currently it's very strict about deserializing enum values from API - if value not present on the list of possible values is present it usually throws exception. We plan change this to allow any custom values during deserialization. I'll also check what we could do from the spec side.
Description of the Issue
I have started to migrate a BoxNodeSDK app to the BoxTSSDK.
My app is an Box Web Integration with an OAuth2 Authentication.
When I use the function
await oauth.getTokensAuthorizationCodeGrant('code');
, the Box TS SDK throw :Steps to Reproduce
Error Message, Including Stack Trace
Patch
I have investigate on my side and it's look like that the scope 'item_read' is missing inside the deserializeFileOrFolderScopeScopeField() loop.
box-typescript-sdk-gen/lib/schemas/fileOrFolderScope.generated.js:55 :
Versions Used
Typescript SDK: v1.9.0
Platform: Node.js
Node.js : v20.18.1
The text was updated successfully, but these errors were encountered: