I am seeing behavior in 100.6 (probably there in all 100.x) where UserCredential concatenates @Domain onto the end of the username. So if I do the following ...
UserCredential mAgencyCredentials = new UserCredential(Domain\mMouse, password);
mAgencyCredential immediately returns ..
"mMouse@domain"
in LogCat...
mAgencyCredentials = {UserCredential@12352}
mPassword = "obfuscated"
mReferer = null
mToken = null
mUsername = "mMouse@Domain"
In this case I am using the UserCredential to access an on premise feature service (shared via AGOL in our organization but the service itself is on an internal ArcGIS Server instance).
The username format causes us all sorts of problems from that moment forward as described below...
A little more information. This is the LogCat from Android Studio....
error = {ArcGISRuntimeException@9380} "com.esri.arcgisruntime.ArcGISRuntimeException: Attempted to use invalid JSON: Name property is missing"
error.mAdditionalMessage = "Name property is missing"
error.mCause = null
error.mCode = 21
error.mDomain = {ArcGISRuntimeException$ErrorDomain@9390} "ARCGIS_RUNTIME"
error.mErrorMessage = "Attempted to use invalid JSON"
error.backtrace = null
error.cause = {ArcGISRuntimeException@9380} "com.esri.arcgisruntime.ArcGISRuntimeException: Attempted to use invalid JSON: Name property is missing"
error.detailMessage = null
error.stackTrace = {StackTraceElement[2]@9395}
error.suppressedExceptions = {Collections$EmptyList@9396} size = 0
error.shadow$_klass_ = {Class@6078} "class com.esri.arcgisruntime.ArcGISRuntimeException"
error.shadow$_monitor_ = 1073823972
cause = null
Hi Aaron Dick,
Thanks for bringing this to our attention, I have looked into it and I found that this is a bug on our API. We are planning to fix it in our future release and unfortunately there's no workaround other than not using usernames that have a 'backward-slash' when using a UserCredential.
Sorry for the inconvenience.