Regression: Exception when deserializing migrated GTMOAuth2 objects #105
Description
This is due to a recent change made in #99
I'm relatively new to AppAuth and GTMAppAuth, so it's very possible I'm misunderstanding how something should be working here - but here's what I'm seeing.
As part of #99 - if you now attempt to init an OIDAuthorizationRequest
with a response type of token
, an exception is thrown. The problem is that GMTOAuth2 apparently used to use token
as a response type, therefore a couple (related) things now break:
-
An exception is thrown when merely deserializing a stored OIDAuthorizationRequest that was set to
token
as the response type -
https://github.com/google/GTMAppAuth - in the
GTMOAuth2KeychainCompatibility.m
, when they are deserializing the old keychain entry to migrate it to a new one, they explicitly usetoken
as the response type inauthorizeFromPersistenceString:serviceProvider:tokenURL:redirectURI:clientID:clientSecret:
. -
Even after I do the migration (by commenting out the change in Throws error on unsupported response type #99), the problem seems to be that
OIDAuthState
stores a request/response history, so_lastAuthorizationResponse
is set to be atoken
response. So, if I make the changes for Throws error on unsupported response type #99 live again, it will still throw the exception every time it grabs the new authorization object that is stored in the keychain.
So, should the changes in #99 be modified to not crash when deserializing an OIDAuthorizationRequest
or is there some other way to handle this?