box-ios-sdk icon indicating copy to clipboard operation
box-ios-sdk copied to clipboard

Refresh token is failing with 401 error code.

Open prasad1240 opened this issue 4 years ago • 2 comments
trafficstars

Authentication Method: User Authentication(OAuth 2.0) SDK: iOS Box SDK Version: 4.2.0 Custom Token info: Yes Xcode: 12.0.1

Code:- if let oAuthSession:OAuth2Session = self.client.session as? OAuth2Session { oAuthSession.refreshToken { result in switch result { case let .success(token): expect(token).to(equal("new access token")) case let .failure(error): fail("refreshToken should succeed, but instead got \(error)") } done() } }

After 24 hours, Refresh token is failing with 401 error code. What is the best practice for iOS SDK refresh token?

Please guide me.

Thanks, Prasad

prasad1240 avatar Dec 01 '20 07:12 prasad1240

@sujaygarlanka , @PJSimon Any update on this please?

prasad1240 avatar Dec 06 '20 19:12 prasad1240

I have the same issue, I can't refresh the token after 24 hours. Im creating a TokenInfo and then after getting the OAuth2Client and im calling refreshToken method from the currentSession, but it's failing with "token is expired".

MirceaX2Mobile avatar Sep 16 '21 13:09 MirceaX2Mobile

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] avatar Dec 19 '22 19:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box iOS SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Dec 28 '22 08:12 stale[bot]