Pilon
Pilon

Reputation: 13

Renew access token on Uber Mobile SDK

How does the Uber Mobile SDK handle renewing access token?

I don’t see there is explicit way that SDK provides for developer to renew access token manually but I’d like to do so.

Essentially, what I’m trying to doing is that my mobile app handles SSO and pass the access token to my server, Server would then use that to do all kinds of request with Uber directly.

But when it comes to managing the access token, I still prefer to let the mobile app to do it. Hence, I’d like to renew the access token whenever I deem necessary, so that I can always provide valid token to my server.

FYI: I’m authenticating using SSO(i.e Native )

Upvotes: 1

Views: 94

Answers (2)

Sasa Jovanovic
Sasa Jovanovic

Reputation: 857

For Android: There is automatic refresh code in the network stack. A refresh token is utilized in the networking stack to refresh the access_token once it expires. So once you get access_token by SSO - even if it was expired - will be refreshed once you get it - so you can use it and pass to your server without any concern is it token expired or not - token will be valid.

Upvotes: 0

Edward Jiang
Edward Jiang

Reputation: 2433

You can instantiate a RidesClient and call refreshAccessToken(usingRefreshToken:completion:)

https://github.com/uber/rides-ios-sdk/blob/master/source/UberRides/RidesClient.swift#L537

Upvotes: 1

Related Questions