When the id_token expires, I can use the refresh_token to create a new one.
However, when I use the refresh token on this endpoint, it doesn't return a new refresh_token. Why is that?
Code Block { grant_type: 'refresh_token', refresh_token: myRefreshToken, redirect_uri: myRedirectUri, client_id: myClientId, client_secret: mySecretToken, }
Because the original refresh token never expires, you can use it over and over until user revokes acces to app or changes password
Original refresh token never expires, agreed. But it can be invalidated by making changes to user profile. After such user actions, Apple will return invalid_grant. So far so good. But why is there a throttle limit of one request per day. Moreover access token issued by Apple expires in 3600 seconds.
I would really like an answer to this last question.
If the idea is that our API server gets a refresh + access token, then passes the access token to the (user side) app client, which they then use as a bearer token to access resources on the API server (at least, I think this is what is implied by the rather not-too-great docs), then you want to be able to either verify the access token on every request to your API server, which includes checking its validity. If it's nearing expiry, you should use the refresh token to request a new access token.
If you have access token validity at 1h, and throttling on token endpoint calls at 1 per day, that's a big fail.
Anyhow, I'd really like to know apple's preferred way of doing this, without us either (1) rolling our own token issuing on our servers; or (2) relying on a service such as Cognito in the middle to handle token issuing.