RADAR-base / RADAR-Docker

Integrated Docker Stack for the RADAR mHealth Streaming Platform Components
https://hub.docker.com/u/radarbase/dashboard/
Apache License 2.0
16 stars 16 forks source link

pRMT login issue with RADAR-Docker #206

Open rtnieuwboer opened 4 years ago

rtnieuwboer commented 4 years ago

Hi all, i have installed the docker version of radar base (Ubuntu 18.04). When i try to register the pRMT app with the QR code, sometimes i succeed (suddenly) but most of the time i get an error that "Authentication failed. Please login...". The url and secret (https://ntr-radar.psy.vu.nl) are included in the Google PlayStore version. I have included the client log file. What is going wrong? Thanks in advance.

11-22 21:35:09.862 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:39:54.498 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:39:59.362 29789 29789 I pRMT:RadarLoginActivity: Read tokenUrl: https://ntr-radar.psy.vu.nl/managementportal/api/meta-token/ygOVUZFI3hjM 11-22 21:39:59.371 29789 29789 I pRMT:RadarLoginActivity: Network change: true 11-22 21:39:59.373 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:39:59.491 29789 28495 I pRMT:ManagementPortalS: Retrieved refreshToken from url 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: Failed to get access token 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: org.radarcns.producer.AuthenticationException: QR code is invalid: {"timestamp":"2019-11-22T20:40:00.076+0000","status":401,"error":"Unauthorized","message":"Bad credentials","path":"/managementportal/oauth/token"} 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalClient.handleRequest(ManagementPortalClient.java:200) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalClient.refreshToken(ManagementPortalClient.java:188) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.refreshToken(ManagementPortalService.java:225) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.getRefreshToken(ManagementPortalService.java:179) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.onHandleIntent(ManagementPortalService.java:122) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at android.os.Handler.dispatchMessage(Handler.java:106) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at android.os.Looper.loop(Looper.java:214) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: at android.os.HandlerThread.run(HandlerThread.java:65) 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: Failed to interact with ManagementPortal with AppAuthState{projectId='null', 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: userId='null', 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: token='null', 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: tokenType=0, 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: expiration=0, 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: lastUpdate=0, 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: attributes={org.radarcns.android.auth.portal.ManagementPortalClient.baseUrl=https://ntr-radar.psy.vu.nl/, org.radarcns.android.auth.portal.ManagementPortalClient.refreshToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJzdWIiOiI0MTE2NDk0OC1iYTY1LTRjMjgtOTllOS0zMmIyMzA5Y2VmYzUiLCJzb3VyY2VzIjpbImJkZjNhOWFkLTViMTktNDZhNS05ZmU1LTFhYmE0ZTRlYTAzMiJdLCJ1c2VyX25hbWUiOiI0MTE2NDk0OC1iYTY1LTRjMjgtOTllOS0zMmIyMzA5Y2VmYzUiLCJyb2xlcyI6WyJudHItdGVzdC0wMDE6Uk9MRV9QQVJUSUNJUEFOVCJdLCJpc3MiOiJNYW5hZ2VtZW50UG9ydGFsIiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9QQVJUSUNJUEFOVCJdLCJjbGllbnRfaWQiOiJwUk1UIiwiYXVkIjpbInJlc19nYXRld2F5IiwicmVzX01hbmFnZW1lbnRQb3J0YWwiXSwiZ3JhbnRfdHlwZSI6ImF1dGhvcml6YXRpb25fY29kZSIsInNjb3BlIjpbIlNPVVJDRVRZUEUuUkVBRCIsIlJPTEUuUkVBRCIsIlNVQkpFQ1QuVVBEQVRFIiwiTUVBU1VSRU1FTlQuQ1JFQVRFIiwiUFJPSkVDVC5SRUFEIiwiVVNFUi5SRUFEIiwiU09VUkNFLlJFQUQiLCJTT1VSQ0VEQVRBLlJFQUQiLCJTVUJKRUNULlJFQUQiXSwiYXRpIjoiMGRiNGMzNDktNjM5My00ZGVjLTk4OTctMjA0ODI1ZWRjYmQ4IiwiZXhwIjoxNTgyNDAzOTkyLCJpYXQiOjE1NzQ0NTUxOTIsImp0aSI6ImU2ZDY3ZDI2LWZkZjgtNDkzYS05MmU ..., org.radarcns.android.auth.portal.ManagementPortalClient.privacyPolicyUrl=http://info.thehyve.nl/radar-cns-privacy-policy}, 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: sourceMetadata=[], 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: headers=[], 11-22 21:40:00.146 29789 28495 E pRMT:ManagementPortalS: isPrivacyPolicyAccepted=false 11-22 21:40:00.146 29789 29789 I pRMT:RadarLoginActivity: Closing progress window 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: Failed to log in with org.radarcns.android.auth.portal.ManagementPortalLoginManager@be5d18f 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: org.radarcns.producer.AuthenticationException: Cannot authenticate 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager.handleRefreshTokenResult(ManagementPortalLoginManager.java:111) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager.access$000(ManagementPortalLoginManager.java:31) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager$1.onReceiveResult(ManagementPortalLoginManager.java:46) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:50) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at android.os.Handler.handleCallback(Handler.java:873) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at android.os.Handler.dispatchMessage(Handler.java:99) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at android.os.Looper.loop(Looper.java:214) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at android.app.ActivityThread.main(ActivityThread.java:6990) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at java.lang.reflect.Method.invoke(Native Method) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 11-22 21:40:00.166 29789 29789 E pRMT:RadarLoginActivity: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445) 11-22 21:40:02.498 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:27.612 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:41.621 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:42.617 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:43.653 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:47.357 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:51.635 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:40:54.661 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:01.588 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:02.599 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:03.619 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:08.674 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:12.780 29789 29789 I pRMT:RadarLoginActivity: Read tokenUrl: https://ntr-radar.psy.vu.nl/managementportal/api/meta-token/NqNDnm70fXpj 11-22 21:41:12.785 29789 29789 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:12.786 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:12.908 29789 28695 I pRMT:ManagementPortalS: Retrieved refreshToken from url 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: Failed to get access token 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: org.radarcns.producer.AuthenticationException: QR code is invalid: {"timestamp":"2019-11-22T20:41:13.495+0000","status":401,"error":"Unauthorized","message":"Bad credentials","path":"/managementportal/oauth/token"} 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalClient.handleRequest(ManagementPortalClient.java:200) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalClient.refreshToken(ManagementPortalClient.java:188) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.refreshToken(ManagementPortalService.java:225) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.getRefreshToken(ManagementPortalService.java:179) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at org.radarcns.android.auth.portal.ManagementPortalService.onHandleIntent(ManagementPortalService.java:122) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at android.os.Handler.dispatchMessage(Handler.java:106) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at android.os.Looper.loop(Looper.java:214) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: at android.os.HandlerThread.run(HandlerThread.java:65) 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: Failed to interact with ManagementPortal with AppAuthState{projectId='null', 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: userId='null', 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: token='null', 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: tokenType=0, 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: expiration=0, 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: lastUpdate=0, 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: attributes={org.radarcns.android.auth.portal.ManagementPortalClient.baseUrl=https://ntr-radar.psy.vu.nl/, org.radarcns.android.auth.portal.ManagementPortalClient.refreshToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJzdWIiOiI0MTE2NDk0OC1iYTY1LTRjMjgtOTllOS0zMmIyMzA5Y2VmYzUiLCJzb3VyY2VzIjpbImJkZjNhOWFkLTViMTktNDZhNS05ZmU1LTFhYmE0ZTRlYTAzMiJdLCJ1c2VyX25hbWUiOiI0MTE2NDk0OC1iYTY1LTRjMjgtOTllOS0zMmIyMzA5Y2VmYzUiLCJyb2xlcyI6WyJudHItdGVzdC0wMDE6Uk9MRV9QQVJUSUNJUEFOVCJdLCJpc3MiOiJNYW5hZ2VtZW50UG9ydGFsIiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9QQVJUSUNJUEFOVCJdLCJjbGllbnRfaWQiOiJwUk1UIiwiYXVkIjpbInJlc19nYXRld2F5IiwicmVzX01hbmFnZW1lbnRQb3J0YWwiXSwiZ3JhbnRfdHlwZSI6ImF1dGhvcml6YXRpb25fY29kZSIsInNjb3BlIjpbIlNPVVJDRVRZUEUuUkVBRCIsIlJPTEUuUkVBRCIsIlNVQkpFQ1QuVVBEQVRFIiwiTUVBU1VSRU1FTlQuQ1JFQVRFIiwiUFJPSkVDVC5SRUFEIiwiVVNFUi5SRUFEIiwiU09VUkNFLlJFQUQiLCJTT1VSQ0VEQVRBLlJFQUQiLCJTVUJKRUNULlJFQUQiXSwiYXRpIjoiZGY0NDAyNzAtMWFiZS00ZTk1LTg5MDEtMmRkNTAxMmE2Y2FjIiwiZXhwIjoxNTgyNDA0MDY3LCJpYXQiOjE1NzQ0NTUyNjcsImp0aSI6ImM2Nzk4ZDBjLTQ4MTQtNGM1My1iNjI ..., org.radarcns.android.auth.portal.ManagementPortalClient.privacyPolicyUrl=http://info.thehyve.nl/radar-cns-privacy-policy}, 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: sourceMetadata=[], 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: headers=[], 11-22 21:41:13.456 29789 28695 E pRMT:ManagementPortalS: isPrivacyPolicyAccepted=false 11-22 21:41:13.458 29789 29789 I pRMT:RadarLoginActivity: Closing progress window 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: Failed to log in with org.radarcns.android.auth.portal.ManagementPortalLoginManager@be5d18f 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: org.radarcns.producer.AuthenticationException: Cannot authenticate 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager.handleRefreshTokenResult(ManagementPortalLoginManager.java:111) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager.access$000(ManagementPortalLoginManager.java:31) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at org.radarcns.android.auth.portal.ManagementPortalLoginManager$1.onReceiveResult(ManagementPortalLoginManager.java:46) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:50) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at android.os.Handler.handleCallback(Handler.java:873) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at android.os.Handler.dispatchMessage(Handler.java:99) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at android.os.Looper.loop(Looper.java:214) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at android.app.ActivityThread.main(ActivityThread.java:6990) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at java.lang.reflect.Method.invoke(Native Method) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 11-22 21:41:13.496 29789 29789 E pRMT:RadarLoginActivity: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445) 11-22 21:41:15.431 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:17.655 29789 29849 I pRMT:RadarLoginActivity: Network change: true 11-22 21:41:18.494 29789 29849 I pRMT:RadarLoginActivity: Network change: true

nivemaham commented 4 years ago

@rtnieuwboer From org.radarcns.producer.AuthenticationException: QR code is invalid: {"timestamp":"2019-11-22T20:40:00.076+0000","status":401,"error":"Unauthorized","message":"Bad credentials","path":"/managementportal/oauth/token"} It looks like your pRMT client secret does not match with what the playstore app has. Have you already contacted someone at radar-base@thehyve.nl with your url and registered your client secret on firebase config?

rtnieuwboer commented 4 years ago

I have contacted them but nothing heard yet. But why does it succeed once in a while? Thanks.

nivemaham commented 4 years ago

What do you mean by once in a while? when is the last time it succeeded. If it fails it means it cannot get a new token.

rtnieuwboer commented 4 years ago

I will test everything again. Let you know...

rtnieuwboer commented 4 years ago

... base64-decodes as: pRMT:secret

yatharthranjan commented 4 years ago

hi @rtnieuwboer, this is probably because on your deployment of the platform (and on management portal), the secret for the pRMT app is configured as secret or empty but the default value on Firebase is as reported by you ********. Please don't put secret information on public issues here. it should be fixed by getting your secret on the Firebase config as @nivemaham suggested

nivemaham commented 4 years ago

@rtnieuwboer If you can communicate the correct secret you have configured for pRMT I can configure that on firebase. I was given a secret from Lianne from vumc and it is configured for your URL. hat please communicate it to me.

rtnieuwboer commented 4 years ago

I have installed it for Lianne from VU. So the url and secret she send you are the ones i use.

rtnieuwboer commented 4 years ago

I have done some more pRMT app debugging:

(url/secret read from "RADAR configuration changed: RadarConfiguration:")

Wipe data&cache/Remove/Install/Open (fetch) (firebaseremoteconfigfetch first failed!) url: default: secret: default

Scan QR (no fetch, only "Broadcast config changed based on base URL") url: my-url secret: default result: ERROR

Wipe data&cache/Open (fetch) url: my-url secret: my-secret result: SUCCES (at least the app has started..)


Without the last wipe/open the QR code scan never succeeds. What am i doing wrong?

Thanks.

nivemaham commented 4 years ago

I don't understand your comments. Which data are you wiping? on Phone or you server. Please provide enough and concise background on the issue.

If you want to scan a new QR code, I advice to clear the data of the app before doing so.

Did you change your secret for pRMT on ManagementPortal permanently? That is on the csv file mounted as volume etc/managementportal/config/oauth_client_details.csv The csv file will override the values every-time you restart the ManagementPortal for the clients that are in the csv. So if the value is not here, it won't work after you restart. The only reason I could think it was working earlier and not working later could be due to this.

rtnieuwboer commented 4 years ago

I wipe the data on my phone not on the server. The secret on the server is the right one, otherwise I would never succeed in logging in with the app.

When I scan a QR code the base url changes but why is the secret not being refreshed to match the url, from firebase?

Van: Nivethika Mahasivam notifications@github.com Verzonden: 29 November 2019 15:53 Aan: RADAR-base/RADAR-Docker RADAR-Docker@noreply.github.com CC: Nieuwboer, R.T. rt.nieuwboer@vu.nl; Mention mention@noreply.github.com Onderwerp: Re: [RADAR-base/RADAR-Docker] pRMT login issue with RADAR-Docker (#206)

I don't understand your comments. Which data are you wiping? on Phone or you server. Please provide enough and concise background on the issue.

If you want to scan a new QR code, I advice to clear the data of the app before doing so.

Did you change your secret for pRMT on ManagementPortal permanently? That is on the csv file mounted as volume etc/managementportal/config/oauth_client_details.csv The csv file will override the values every-time you restart the ManagementPortal for the clients that are in the csv. So if the value is not here, it won't work after you restart. The only reason I could think it was working earlier and not working later could be due to this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/RADAR-base/RADAR-Docker/issues/206?email_source=notifications&email_token=AIRMSERBPM2VMKMNYWK2AGDQWEUEPA5CNFSM4JRJWR72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFPBL4Q#issuecomment-559814130, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIRMSEXWVHD3OBG53JILJBTQWEUEPANCNFSM4JRJWR7Q.

rtnieuwboer commented 4 years ago

Sorry the last part should be:

Wipe data&cache/Open (fetch) url: default-url secret: my-secret (how is this possible?) result: ERROR

Scan QR: result: SUCCES (at least the app has started..)

Probably i do not understand the whole flow...

afolarin commented 4 years ago

Was this solved?

iDmple commented 3 years ago

No, it isn't solved. We have the same issue and have tried everything mentioned in this ticket without success. Please advise.