Invalid JSON 'claims' value encountered - msal

I am using MSAL for Android and confused about this error:
com.microsoft.identity.common.java.exception.ServiceException: Invalid JSON 'claims' value encountered
at com.microsoft.identity.common.java.controllers.ExceptionAdapter.exceptionFromAcquireTokenResult(ExceptionAdapter.java:96)
at com.microsoft.identity.common.java.controllers.CommandDispatcher.getCommandResultFromTokenResult(CommandDispatcher.java:572)
at com.microsoft.identity.common.java.controllers.CommandDispatcher.executeCommand(CommandDispatcher.java:480)
at com.microsoft.identity.common.java.controllers.CommandDispatcher.access$100(CommandDispatcher.java:85)
at com.microsoft.identity.common.java.controllers.CommandDispatcher$5.run(CommandDispatcher.java:648)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
Caused by: com.microsoft.identity.client.exception.MsalServiceException: Invalid JSON 'claims' value encountered
at com.microsoft.identity.client.internal.controllers.MsalExceptionAdapter.msalExceptionFromBaseException(MsalExceptionAdapter.java:74)
at com.microsoft.identity.client.SingleAccountPublicClientApplication$3.onError(SingleAccountPublicClientApplication.java:351)
at com.microsoft.identity.client.SingleAccountPublicClientApplication$3.onError(SingleAccountPublicClientApplication.java:337)
at com.microsoft.identity.common.java.controllers.CommandDispatcher.commandCallbackOnError(CommandDispatcher.java:534)
at com.microsoft.identity.common.java.controllers.CommandDispatcher.access$1000(CommandDispatcher.java:85)
at com.microsoft.identity.common.java.controllers.CommandDispatcher$4.run(CommandDispatcher.java:514)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
how to fix this com.microsoft.identity.client.exception.MsalServiceException?

In my case it was an expired Azure Subscription. The free trial has ended and I had to upgrade to pay as you go subscription.
Go to Cost Management in Azure Portal and check for red boxes or warnings and fix them.

I detected today the same issue, without any change on the code, I get now the error message. The LogIn screen is shown, I can indicate user and password, but then I get the same exception.
I renewed already the app registration in Azure, but no solution.
Did you change anything in your app before? Or did you add any new library?

Related

xamarin map LocationServices SettingsApi

I'm having a crash in a Xamarin.Android App, but this ONLY happens in RELEASE mode.
The issue is when accesing the map. So, I've extracted the device log and after analyzed it, I've found these lines:
03-19 19:55:10.305 HUAWEI JKM-LX3 Error 14753 AndroidRuntime java.lang.NoSuchFieldError: no "Lcom/google/android/gms/location/SettingsApi;" field "SettingsApi" in class "Lcom/google/android/gms/location/LocationServices;" or its superclasses
at mono.android.content.DialogInterface_OnClickListenerImplementor.n_onClick(Native Method)
at mono.android.content.DialogInterface_OnClickListenerImplementor.onClick(Unknown Source:0)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:174)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
03-19 19:55:10.305 HUAWEI JKM-LX3 Error 14753 AndroidRuntime Process: com.companyname.app, PID: 14753
03-19 19:55:10.305 HUAWEI JKM-LX3 Error 14753 AndroidRuntime FATAL EXCEPTION: main
After a few google searches, I've found this answer, but it comes from 2018, and it's not related to Xamarin. One of the comments says that "Google just deprecated GoogleApiCLient" in 2018.
Another resource I've found is this one which, kinda seems familiar, but it comes from a plugin repo in github. A user says that he had to reverse to 1.5.7, but what package is he talking about?
Again, this happens only in RELEASE mode, for Google Play. In DEBUG mode the maps works fine, no problem at all.
If you require more data, just tell me.
Thanks for your help.

How to deal with `app_engine_apis` warning when updating app.yaml from go114 to go115

I recently updated my app.yaml from
runtime: go114
to
runtime: go115
because I was warned in an email that support for go114 was ending.
The service deployed fine but after it finished, I got the message:
Updating service [default]...â ¼WARNING: There is an indirect dependency on App Engine APIs, but they are not enabled in your app.yaml. You may see runtime errors trying to access these APIs. Set the app_engine_apis property.
So I added:
app_engine_apis: true
And now the service won't deploy and gives this error:
ERROR: (gcloud.app.deploy) An error occurred while parsing file: [<snip>/app.yaml]
Unexpected attribute 'app_engine_apis' for object of type AppInfoExternal.
Looks like a catch 22. How do I deal with this?
Posting this as community wiki as it's based on #Joel's comments.
It looks like this is being triggered, since those APIs aren't enabled yet in go115, you might get a runtime error.
I would say that you should probably reach out to Google Cloud either in their Issue Tracker system or open an Issue in this Github Page so that they can fix this issue, as there doesn't seem to be any workarounds for this one.

Firebase Test Lab error "Unexpected error abandoning session"

A lot of my tests fail on Firebase Test Lab. I tend to see the following error:
04-28 20:54:13.686: W/Finsky(11726): [141] nao.b(6): Unexpected error abandoning session=726608967. exception=java.lang.SecurityException: Caller has no access to session 726608967
First of all, what component is Finsky?
Does anyone have any idea what could be causing this and how to fix it?
Finsky is the Google Play Store. There's not much info here to go on, but perhaps your app doesn't have some needed permission declared in your manifest?

Xamarin.Forms app crashes after update

I have checked all the questions raised in SO like this and i couldn't find answer to my issue.
We had an app in PlayStore which is developed in Xamarin.Android with code shared with Xamarin.iOS via Shared Project.
Now we are switching to Xamarin.Forms. We have changed ,
Some UI
Login mechanism with AutoLogin based on Token stored in local device.
The app working fine in Devices and Simulators.
We have uploaded our app to playstore. If the user have old version in their device, after update the app crashing after showing splashscreen for few seconds.
If we uninstall the old version, it is working fine.
Error in google console:
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java030)
at android.app.ActivityThread.-wrap11 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6938)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java27)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Caused by: java.lang.ClassCastException:
at android.app.SharedPreferencesImpl.getLong (SharedPreferencesImpl.java:279)
at md56c96bd185bfbb3ebebdd94ef17444e8f.MainActivity.n_onCreate (Native Method)
at md56c96bd185bfbb3ebebdd94ef17444e8f.MainActivity.onCreate (MainActivity.java1)
at android.app.Activity.performCreate (Activity.java:7174)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2908)
We are not sure why this is happening. Can any one let me know, why this happening and how to prevent it. Also, is it possible reproduce this issue in VisualStudio?
Thanks
Probably your SharedPreferences parameters have incompatible types. And I didn't found a proof that it could be xamarin.Forms problem. If you look at the source code SharedPreferencesImpl.java to the getLong method you will see the following cast:
Long v = (Long)mMap.get(key);
This means that on old versions there was parameter with the same name but with type different from Long. You read this parameter in onCreate method of your MainActivity, but parameter type is incompatible.

Getting error in google fit "Connection failed. Cause: ConnectionResult{statusCode=unknown status code 5005, resolution=null}"

I have tried to develop application using google fit. I follow This link
When i try to run that application i got the following error
10-27 11:55:19.966: I/Google Fit(6016): Connection failed. Cause: ConnectionResult{statusCode=unknown status code 5005, resolution=null}
10-27 11:55:19.966: E/GooglePlayServicesUtil(6016): Unexpected error code 5005
Finally i found that issues. We need to save the content in consent screen under oath and api
I had this error and the consent screen had been filled in correctly. The only way I could get around this was to delete the project and re-create it.

Resources