Skip to content

Regression: Exception when deserializing migrated GTMOAuth2 objects #105

Closed
@chrismcs

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:

  1. An exception is thrown when merely deserializing a stored OIDAuthorizationRequest that was set to token as the response type

  2. 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 use token as the response type in authorizeFromPersistenceString:serviceProvider:tokenURL:redirectURI:clientID:clientSecret:.

  3. 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 a token 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?

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions