AppAuth-iOS
AppAuth-iOS copied to clipboard
Serialisation of AuthState failed
When I try to Serialise The AuthState, it failed during unarchiving.
what I do is:
do { let archivedState = try NSKeyedArchiver.archivedData(withRootObject: state, requiringSecureCoding: true) UserDefaults.standard.set(archivedState, forKey: "SavedAuthSateKey") UserDefaults.standard.synchronize() } catch { print("error while archiving") }
and after when I try to unarchive it:
guard let data = UserDefaults.standard.object(forKey: "SavedAuthSateKey") as? Data else { throw RemoteError.badURL } let state = try NSKeyedUnarchiver.unarchivedObject(ofClass: OIDAuthState.self, from: data)
It throws an error during unarchiving: 2022-01-20 15:26:29.477582+0100 SHARE-SSO[74484:30434261] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x105e7fd58) [/Applications/Xcode 13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'OIDServiceDiscovery' (0x101686ab8) [/Users/mehboobalam/Library/Developer/CoreSimulator/Devices/5FB33B70-EE1A-4423-A04C-172417CF59B7/data/Containers/Bundle/Application/42B0FF94-6929-477F-BE50-EE8E477479AF/SHARE-SSO.app]" )}'. This will be disallowed in the future. 2022-01-20 15:26:29.478058+0100 SHARE-SSO[74484:30434261] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x105e7fd58) [/Applications/Xcode 13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'OIDServiceDiscovery' (0x101686ab8) [/Users/mehboobalam/Library/Developer/CoreSimulator/Devices/5FB33B70-EE1A-4423-A04C-172417CF59B7/data/Containers/Bundle/Application/42B0FF94-6929-477F-BE50-EE8E477479AF/SHARE-SSO.app]" )}'. This will be disallowed in the future. 2022-01-20 15:26:29.478248+0100 SHARE-SSO[74484:30434261] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x105e7fd58) [/Applications/Xcode 13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'OIDServiceDiscovery' (0x101686ab8) [/Users/mehboobalam/Library/Developer/CoreSimulator/Devices/5FB33B70-EE1A-4423-A04C-172417CF59B7/data/Containers/Bundle/Application/42B0FF94-6929-477F-BE50-EE8E477479AF/SHARE-SSO.app]" )}'. This will be disallowed in the future. 2022-01-20 15:26:29.478457+0100 SHARE-SSO[74484:30434261] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x105e7fd58) [/Applications/Xcode 13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'OIDServiceDiscovery' (0x101686ab8) [/Users/mehboobalam/Library/Developer/CoreSimulator/Devices/5FB33B70-EE1A-4423-A04C-172417CF59B7/data/Containers/Bundle/Application/42B0FF94-6929-477F-BE50-EE8E477479AF/SHARE-SSO.app]" )}'. This will be disallowed in the future. 2022-01-20 15:26:29.483827+0100 SHARE-SSO[74484:30434261] *** Assertion failure in -[OIDAuthorizationRequest initWithConfiguration:clientId:clientSecret:scope:redirectURL:responseType:state:nonce:codeVerifier:codeChallenge:codeChallengeMethod:additionalParameters:], OIDAuthorizationRequest.m:147