IOS - SDK - App User Login Issue
AnsweredThis is related to a previous post; however, I changed our login to use app users and retreive the token from our backend API. The backend API grabs the JWT token from Box and will either use it itself or pass it back to the moble.
The problem I am seeing is (after enabling the Box API Log output to NSLog) is the SDK will hang on a request to: api.box.com/2.0/users/me
Inceidentilly, this was the same place that it was failing while we were using in-app oauth. The login screen would not be cleared since the SDK was hung trying to reach /users/me
When I drop the returned token into postman and manully mess with the same token it works. I can intercept the call using fiddler. This seems to be localized into the box sdk itself.
-
I implemented file upload using JWT auth and the iOS SDK in step 4 of this blog post. Can you please take a look, and let me know if there any differences between my implementation and yours? Is the application failing right after calling the setAccessTokenDelegate:self method or another method?
-
Thank you for responding, I actaully used this blog post as a resource in implementing the intergration in the first place. I am going to mark your soluiton as the answer since my problem was resolved; however, I still do not know why it was failing in the first place.
The sdk was failing after the completion method in the fetchAccessTokenWithCompletion. The SDK (Box NSLog output was turned on via #define) appeared to be hanging on fetching the /2.0/users/me call. More intresting is when added to a fiddler proxy I did not see any traffic heading to box at that point. It appeared that it failed before attempting to send. I wish I had the debug log screen handy that I could attach here but I did not keep them around after I resoved the issue.
Since the /2.0/users/me call failed the autheticateWithCompletionBlock never called the completion method. One thing that may be helpful to add is a timeout on some of these methods.
Thanks Again.
-
The issue started occuring again - this time i was able to capture the output of my app log. The App just hangs waiting for it to return from the users/me.
20**removed**:37:05.764299 [4219:2617290] splitViewController viewControllers at index 1 at load attachment click 20**removed**:37:05.814559 [4219:2617290] -[BOXParallelAPIQueueManager enqueueOperation:]: enqueued GET (null) on global queue 20**removed**:37:05.815045 [4219:2617387] __50+[BOXAPIOperation globalAPIOperationNetworkThread]_block_invoke: {number = 7, name = Box API Operation Thread} started 20**removed**:37:06.821329 IAFLMobile[4219:2617290] Box Session { AuthVersion = 1; "access_token" = ; "expires_in" = 3600; "refresh_token" = ""; "restricted_to" = ""; "token_type" = bearer; } 20**removed**:37:06.827031 [4219:2617290] -[BOXParallelAPIQueueManager enqueueOperation:]: enqueued GET https://api.box.com/2.0/users/me on global queue 20**removed**:37:06.827362 [4219:2617290] -[BOXAPIQueueManager AuthOperationDidComplete:]: GET (null) completed. Removing from set of Auth dependencies 20**removed**:37:06.827942 [4219:2617290] -[BOXAPIAppUsersAuthOperation finish]: BOXAPIOperation GET (null) finished with state 3 20**removed**:37:06.828662 [4219:2617557] -[BOXAPIOperation executeOperation]: BOXAPIOperation GET https://api.box.com/2.0/users/me was started 20**removed**:37:06.830655 [4219:2617557] -[BOXAPIOperation executeOperation]: Starting GET https://api.box.com/2.0/users/me
-
Thanks for sharing the additional details and posting the log. I am not sure why this is occuring.
Can you please post this as an issue on our iOS SDK repo? I'll ask our iOS team to take a look.
Please sign in to leave a comment.
Comments
5 comments