eduvpn / apple

app for iOS and macOS
Other
61 stars 18 forks source link

Do not use AuthState with non-matching endpoints #512

Closed roop closed 1 year ago

roop commented 1 year ago

Fixes #487.

In moving from APIv2 to APIv3, the server endpoints changed. After that, when the client connects to the server, it resulted in an error because the client was using a cached OIDAuthState object, which included the endpoints used -- when refreshing the token, AppAuth used the endpoints stored in the OIDAuthState, instead of the provided endpoints.

In this PR, we check if the endpoints stored in the OIDAuthState are the same as the ones we want to contact. AppAuth exposes the endpoints stored in the AuthState, so we are able to check it without having to modify AppAuth.