trivago / Heimdallr.swift

Easy to use OAuth 2 library for iOS, written in Swift.
Apache License 2.0
639 stars 86 forks source link

Refresh Token in a different URL #75

Closed dccarmo closed 8 years ago

dccarmo commented 8 years ago

So I'm currently working with an API that have a different endpoint for token refresh. How can I let Heimdallr know the refresh token URL (and maybe even allow the application to set parameters)?

bckr commented 8 years ago

Heimdallr does not support setting a different endpoint for the token refresh. To my knowledge it would be very unusual to define a separate endpoint just for refreshing the token. From the RFC:

The token endpoint is used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly).

Out of curiosity: Is there a special reason why the API defines a separate endpoint for the refresh?

dccarmo commented 8 years ago

There isn't, actually. I talked to the back-end team and they admitted that their API wasn't following OAuth specs, so they updated and now everything is good. Sorry for not coming back to report this.

bckr commented 8 years ago

Cool! Glad it worked out for you 👍