-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading capacitor-secure-storage-plugin to 0.8.0 Produces Error During Login on Ionic 6 [ios/iphone] #177
Comments
How long are your access tokens valid for? I see a token expired error in your logs.
|
Hi Matt,
Thanks for getting back to me so quickly. Tokens are valid for 60 minutes.
Curious as to how you gleaned that the access token was expired? Via jwt.io?
The context of the access token retrieval below is the handshake and token
directly received from the IDP server right after logging in so I have my
doubts on the expiration. In the case of referencing 0.6.2, the handshake
and token works just as expected. I'm wondering how updating to 0.8.0 could
cause this issue?
…On Tue, Oct 18, 2022, 9:36 AM Matt Raible ***@***.***> wrote:
How long are your access tokens valid for? I see a token expired error in
your logs.On Oct 18, 2022, at 02:44, Diran Ogunlana ***@***.***> wrote:
We just upgraded to Ionic 6 from Ionic 5 where we updated the
capacitor-secure-storage-plugin from 0.6.2 to 0.8.0. On Android, the login
works as expected; but, on ios, after logging in, the screen redirects to
app without the login token which causes the app to appear like it has not
logged in.
It gets even weirder: when testing in xcode emulator of an iphone, the
login works as expected. But, when testing on an actual physical iphone
device e.g., iphone7 or higher, the login fails.
Here is the log of the failure when debugging with a physical iphone
device:
2022-10-17 21:58:04.854966+1100 App[746:21910] 10.0.0 -
[FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy
enabled, will swizzle remote notification receiver handlers. If you'd
prefer to manually integrate Firebase Messaging, add
"FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO.
Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2022-10-17 21:58:05.032410+1100 App[746:21651] KeyboardPlugin: resize mode
- native
⚡️ Loading app at capacitor://localhost...
⚡️ [log] - onscript loading complete
⚡️ WebView loaded
⚡️ To Native -> App addListener 33191965
⚡️ To Native -> Device getInfo 33191966
2022-10-17 21:58:05.473957+1100 App[746:21913] [client] 114
CDPurgeableResultCache _recentPurgeableTotals no result for
/private/var/wireless/baseband_data, setting to zero
2022-10-17 21:58:05.477229+1100 App[746:21913] [client] 114
CDPurgeableResultCache _recentPurgeableTotals no result for
/private/var/MobileSoftwareUpdate, setting to zero
2022-10-17 21:58:05.478837+1100 App[746:21913] [client] 114
CDPurgeableResultCache _recentPurgeableTotals no result for
/private/var/hardware, setting to zero
⚡️ TO JS
{"osVersion":"16.0.3","manufacturer":"Apple","diskTotal":255968497664,"operatingSystem":"ios","realDiskTotal":255968497664,"diskFree":122981343232,"name":"iPhone","model":"iPhone10,4","isVirtual":false,"memUsed":95174656,"webViewVersion":"16.0.3","realDisk
⚡️ [log] - {"action":"Init"} actionssss
⚡️ To Native -> SplashScreen hide 33191967
⚡️ To Native -> SecureStoragePlugin get 33191968
⚡️ TO JS undefined
⚡️ TO JS
{"value":"{\"access_token\":\"eyJhbGciOiJSUzI1NiIsImtpZCI6IkI1RUIyRTNDRTZBNzU3OEJFQjg3RDk3QkZEMENDNDFBMzFGMDI2RTkiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJ0ZXN1UE9hblY0dnJoOWw3X1F6RUdqSHdKdWsifQ.eyJuYmYiOjE2MTYwNzIwNDgsImV4cCI6MTYxNjA3NTY0OCwiaXNzIjoiaHR0cHM6Ly9kZXY
⚡️ [log] - {"action":"Get Token From Storage Failed","error":"Token Has
Expired"} actionssss
⚡️ To Native -> App addListener 33191969
⚡️ To Native -> SecureStoragePlugin set 33191970
⚡️ To Native -> SecureStoragePlugin set 33191971
⚡️ To Native -> Browser addListener 33191972
⚡️ To Native -> Browser open 33191973
⚡️ TO JS {"value":true}
⚡️ TO JS {"value":true}
2022-10-17 21:58:21.633309+1100 App[746:21651] Unbalanced calls to
begin/end appearance transitions for <Capacitor.TmpViewController:
0x13dd0eed0>.
⚡️ TO JS undefined
⚡️ TO JS undefined
⚡️ To Native -> SecureStoragePlugin set 33191974
⚡️ To Native -> SecureStoragePlugin set 33191975
⚡️ To Native -> Browser addListener 33191976
⚡️ To Native -> Browser open 33191977
⚡️ TO JS {"value":true}
⚡️ TO JS {"value":true}
2022-10-17 21:58:36.613020+1100 App[746:21651] Unbalanced calls to
begin/end appearance transitions for <Capacitor.TmpViewController:
0x13dd2ca20>.
⚡️ TO JS undefined
⚡️ TO JS
{"iosOpenInPlace":"","iosSourceApplication":"com.apple.SafariViewService","url":"<redacted>:\/\/callback?code=5174B725F9D185AD91B2C81089ADD720EE0C136E36CAE37852C58EE5B1C1257F&scope=openid%20offline_access%20<redacted>%20<redacted>&state=EPyuZnE241&ses
⚡️ To Native -> Browser close 33191978
⚡️ To Native -> SecureStoragePlugin set 33191979
⚡️ TO JS {"value":true}
⚡️ [log] - Checking to see if there is an authorization response to be
delivered.
⚡️ To Native -> SecureStoragePlugin get 33191980
⚡️ TO JS {"value":"nSxeDlhkan"}
⚡️ To Native -> SecureStoragePlugin get 33191981
⚡️ TO JS
{"value":"{\"response_type\":\"code\",\"client_id\":\"mobile\",\"redirect_uri\":\"<redacted>:\/\/callback\",\"scope\":\"openid
offline_access <redacted>
<redacted>\",\"state\":\"EPyuZnE241\",\"extras\":{\"code_challenge\":\"xQ3quEwrxmXvFzeSXPKYy1h1vD9
⚡️ To Native -> SecureStoragePlugin get 33191982
⚡️ TO JS
{"value":"<redacted>:\/\/callback?code=5174B725F9D185AD91B2C81089ADD720EE0C136E36CAE37852C58EE5B1C1257F&scope=openid%20offline_access%20<redacted>%20<redacted>&state=EPyuZnE241&session_state=8NQSI0PxhaeRnXs3YoqqVf42oi6plNATndPQ0SIxs_Y.A56FE663B7B8C3DD
⚡️ To Native -> SecureStoragePlugin remove 33191983
⚡️ To Native -> SecureStoragePlugin remove 33191984
⚡️ To Native -> SecureStoragePlugin remove 33191985
⚡️ TO JS {"value":true}
⚡️ TO JS {"value":true}
⚡️ TO JS {"value":true}
⚡️ TO JS undefined
⚡️ To Native -> SecureStoragePlugin set 33191986
ERROR MESSAGE: {"errorMessage":"error","message":"error"}
⚡️ [error] - {"errorMessage":"error","message":"error"}
⚡️ [error] - ERROR Error: Uncaught (in promise): Error: error
***@***.***://localhost/main.d8a7a647dad5093c.js:1:398
***@***.***:2:709:49
@user-script:2:691:29
global ***@***.***://localhost/landing:1:28
Here is the package.json of the app:
{
"name": "test",
"version": "1.0.0",
"author": "",
"homepage": "",
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"capacitor-resources-android": "capacitor-resources -p android",
"capacitor-resources-ios": "capacitor-resources -p ios",
"cordova-resources-android": "npx cordova-res android --skip-config
--copy",
"cordova-resources-ios": "npx cordova-res ios --skip-config --copy"
},
"private": true,
"dependencies": {
***@***.***/common": "^14.0.0",
***@***.***/core": "^14.0.0",
***@***.***/forms": "^14.0.0",
***@***.***/platform-browser": "^14.0.0",
***@***.***/platform-browser-dynamic": "^14.0.0",
***@***.***/router": "^14.0.0",
***@***.***/android": "4.3.0",
***@***.***/app": "4.0.1",
***@***.***/browser": "^4.0.1",
***@***.***/core": "4.3.0",
***@***.***/device": "^4.0.1",
***@***.***/haptics": "4.0.1",
***@***.***/ios": "4.3.0",
***@***.***/keyboard": "4.0.1",
***@***.***/push-notifications": "^4.1.0",
***@***.***/splash-screen": "^4.0.1",
***@***.***/status-bar": "4.0.1",
***@***.***/app-minimize": "^5.36.0",
***@***.***/core": "^5.36.0",
***@***.***/http": "^5.36.0",
***@***.***/in-app-browser": "^5.36.0",
***@***.***/safari-view-controller": "^5.36.0",
***@***.***/secure-storage": "^5.36.0",
***@***.***/splash-screen": "^5.36.0",
***@***.***/status-bar": "^5.36.0",
***@***.***/angular": "^6.1.9",
***@***.***/storage-angular": "^3.0.6",
***@***.***/appauth": "^1.3.1",
"axios": "^0.27.2",
"capacitor-secure-storage-plugin": "^0.8.0",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-appminimize": "^1.0.1",
"cordova-plugin-preview-any-file": "^0.2.9",
"cordova-plugin-secure-storage-echo": "^5.1.1",
"dotenv": "^16.0.2",
"ionic-appauth": "^0.9.0",
"ionicons": "^6.0.3",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"util": "^0.12.4",
"zone.js": "~0.11.4"
},
"devDependencies": {
***@***.***/build-angular": "^14.0.0",
***@***.***/builder": "~13.0.1",
***@***.***/eslint-plugin": "~13.0.1",
***@***.***/eslint-plugin-template": "~13.0.1",
***@***.***/template-parser": "~13.0.1",
***@***.***/cli": "^14.0.0",
***@***.***/compiler": "^14.0.0",
***@***.***/compiler-cli": "^14.0.0",
***@***.***/language-service": "^14.0.0",
***@***.***/cli": "4.3.0",
***@***.***/angular-toolkit": "^6.0.0",
***@***.***/jasmine": "~3.6.0",
***@***.***/jasminewd2": "~2.0.3",
***@***.***/node": "^12.11.1",
***@***.***/eslint-plugin": "5.3.0",
***@***.***/parser": "5.3.0",
"codelyzer": "^6.0.2",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "~4.7.3"
},
"description": ""
}
Here are the details of the updates on the capacitor-secure-storage plugin
from 0.6.2 to 0.8.0: ***@***.*** We tried using 0.7.1 instead, but it also
fails when testing on a physical iphone device.
We've downgraded to 0.6.2 so that we can roll a production release, but
the underlying issue with downgrading is that it requires version 3 of
@capacitor/core and Ionic 6 works on version 4 of @capacitor/core.
Any guidance on this is much appreciated :)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are
receiving this because you are subscribed to this thread.Message ID:
***@***.***>
—
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZEOAKPC7D52DQOZKFFBRLWD3GZHANCNFSM6AAAAAARH4PVUA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I have the exact same problem. Authentication is working correctly on web, but failing on physical/virtual iOS device with the following log
The code used in the landing page is the same used with ionic-appauth 0.8.5 and previous version of capacitor-secure-storage-plugin, that worked with no errors. I tried checking token expirations and they are valid for 60 minutes, that's not the problem. |
Hi, i get the same error, did you resolve the issue? |
We just upgraded to Ionic 6 from Ionic 5 where we updated the capacitor-secure-storage-plugin from 0.6.2 to 0.8.0. On Android, the login works as expected; but, on ios, after logging in, the screen redirects to app without the login token which causes the app to appear like it has not logged in.
It gets even weirder: when testing in xcode emulator of an iphone, the login works as expected. But, when testing on an actual physical iphone device e.g., iphone7 or higher, the login fails.
Here is the log of the failure when debugging with a physical iphone device:
Here is the
package.json
of the app:Here are the details of the updates on the capacitor-secure-storage plugin from
0.6.2
to0.8.0
: martinkasa/capacitor-secure-storage-plugin@3c1b632. We tried using0.7.1
instead, but it also fails when testing on a physical iphone device.We've downgraded to
0.6.2
so that we can roll a production release, but the underlying issue with downgrading is that it requires version 3 of@capacitor/core
and Ionic 6 works on version 4 of@capacitor/core
.Any guidance on this is much appreciated :)
The text was updated successfully, but these errors were encountered: