# Enrolment fails in android guardian sdk sample app

**URL:** <https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933>\
**Category:** Get Help\
**Tags:** sdk, android, guardian, auth0\
**Created:** [June 26, 2022, 2:09pm UTC](https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933 "2022-06-26T14:09:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharindu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tharindu/32/13837_2.png) [@tharindu](https://community.auth0.com/u/tharindu)\
**Post date:** [June 26, 2022, 2:09pm UTC](https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933/1 "2022-06-26T14:09:59Z")

</div>

Please include the following information in your post:

- Which SDK this is regarding: auth0 guardian android sdk
- SDK Version: 0.6.0
- Platform Version: android
- Code Snippets/Error Messages/Supporting Details/Screenshots:

**Is this a feature request or bug report?** this is a bug report.

Hi ,  
I am trying used the android guardian SDK to build a custom appliction  
I’ve cloned the sample app for android and library, and can’t get an enrolment to work.

When a barcode is scanned, it says **com.auth0.android.guardian.sdk.GuardianException: Error parsing server error response**

,

 ![b1ccb95b-2a37-45c7-9ee8-be245bf33596](https://global.discourse-cdn.com/auth0/original/3X/c/a/ca7dc5697fc131dbe94a4e400683274fde32331f.jpeg)

When I debug it using ADB I see below logs,

**06-26 11:54:31.499 25463 26011 I okhttp.OkHttpClient: ← 401 https://MY\_TENANT\_NAME.auth0.com/api/enroll (507ms)**  
**06-26 11:54:31.503 25463 26011 I okhttp.OkHttpClient: Unauthorized**

plz see the full logs,

6-26 11:54:30.986 25463 25463 E libEGL : Invalid file path for libcolorx-loader.so  
06-26 11:54:30.987 25463 25463 I chatty : uid=10383(com.auth0.guardian.sample) identical 4 lines  
06-26 11:54:30.987 25463 25463 E libEGL : Invalid file path for libcolorx-loader.so  
06-26 11:54:30.987 25463 25463 I InputTransport: Create ARC handle: 0xb400007621848aa0  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: → POST [https://dev-60ywwsqe.us.auth0.com/api/enroll](https://dev-60ywwsqe.us.auth0.com/api/enroll)  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: Content-Type: application/json; charset=utf-8  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: Content-Length: 664  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: Authorization: Ticket id=“5lvpy0Fcw4ADDwydT20M9Kl06JlMMbGD”  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: Accept-Language: en\_GB  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: User-Agent: GuardianSDK/0.0.1-SNAPSHOT Android 11  
06-26 11:54:30.990 25463 26011 I okhttp.OkHttpClient: Auth0-Client: eyJuYW1lIjoiR3VhcmRpYW4uQW5kcm9pZCIsInZlcnNpb24iOiIwLjAuMS1TTkFQU0hPVCJ9  
06-26 11:54:30.991 25463 26011 I okhttp.OkHttpClient: {“public\_key”:{“kty”:“RSA”,“alg”:“RS256”,“e”:“AQAB”,“use”:“sig”,“n”:“AIXlayXsvZg80jIdwEWmJE\_Tz5DBoAaNKewJPozu7nHGn4EL4A3fXr8gHtKiPiW6lcCDgVP3RXsRQDFGoNTjulWOlwJLHp\_OHb9mUuKBgWQnEc5LSFeAu7tET0hNB0hplEH369TcDUtZww3X39dxqzn2Qqf3pTbgphIKzfpO9Dxm5rNkmuQ1rYOElH-\_SVcuk\_LKQgs63okc2CjSfDeyDWR4cfQobwiAwUBdgK-CnHeIqQHV0d8qw9Y5P1NKHsA6SQNi3V\_Kj30rCaYPKFsX97Nqp6rtHqVxns804AdnPTnKFQrLrjWmw3TutPTYCfNbisRudxI\_pn51BgTKgxAaSLs”},“identifier”:“b906cad41b570a72”,“name”:“CPH2001”,“push\_credentials”:{“service”:“GCM”,“token”:“ekim5vMKxHA:APA91bFcR-vU8qMh2ZS9Q6-2irAOMY0ju9B24i5XvzhnxFIMgu0m-60bJBRsJoitHIiZpjOO-fKyuWzFXd9U409umw\_urAHRAEj5aIxAIl90gob\_Q9aQXBgoMlU6oDqHOTPuyyXARjGj”}}  
06-26 11:54:30.991 25463 26011 I okhttp.OkHttpClient: → END POST (664-byte body)  
06-26 11:54:31.014 25463 25463 V OplusZoomWindowDecorViewHelper: setLastReportedMergedConfiguration mZoomDisplayHeight: 2400 getDecorView.DecorView@439e105[EnrollActivity]  
06-26 11:54:31.016 783 1286 I BufferQueueProducer: [com.auth0.guardian.sample/com.auth0.guardian.sample.EnrollActivity#1](https://support.auth0.com/tickets/00759754) connect(): api=1 producerControlledByApp=false  
06-26 11:54:31.031 783 1286 D DispPerfService: onframeavailable pid=25463, slot=2, seq=21354, name=com.auth0.guardian.sample:com.auth0.guardian.sample/com.auth0.guardian.sample.EnrollActivity#1  
06-26 11:54:31.036 783 1286 I BufferQueueProducer: [com.auth0.guardian.sample/com.auth0.guardian.sample.EnrollActivity#0](https://support.auth0.com/tickets/00759754) queueBuffer: fps=9.05 dur=1657.32 max=699.47 min=49.14  
**06-26 11:54:31.499 25463 26011 I okhttp.OkHttpClient: ← 401 https://MY\_TENANT\_NAME.us.auth0.com/api/enroll (507ms)**  
06-26 11:54:31.499 25463 26011 I okhttp.OkHttpClient: date: Sun, 26 Jun 2022 06:24:31 GMT  
06-26 11:54:31.499 25463 26011 I okhttp.OkHttpClient: content-length: 12  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: cf-ray: 7213dc40e9b7b2f9-CMB  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: cache-control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0, no-transform  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: strict-transport-security: max-age=31536000  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: www-authenticate: Bearer realm=“Users”, Bearer realm=“Users”, Missing authentication tokens  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: cf-cache-status: DYNAMIC  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: expect-ct: max-age=604800, report-uri=“[https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct](https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct)”  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: ot-baggage-auth0-request-id: 7213dc40e9b7b2f9  
06-26 11:54:31.500 25463 26011 I okhttp.OkHttpClient: ot-tracer-sampled: true  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: ot-tracer-spanid: 55e478dd700e12eb  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: ot-tracer-traceid: 6bd1c1dd53dd7f3a  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: traceparent: 00-55e478dd700e12eb-00000000000000006bd1c1dd53dd7f3a-01  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: tracestate: auth0-request-id=7213dc40e9b7b2f9  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: x-auth0-requestid: 530204b247221f8fe634  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: x-content-type-options: nosniff  
06-26 11:54:31.501 25463 26011 I okhttp.OkHttpClient: vary: Accept-Encoding  
06-26 11:54:31.502 25463 26011 I okhttp.OkHttpClient: server: cloudflare  
06-26 11:54:31.502 25463 26011 I okhttp.OkHttpClient: alt-svc: h3=“:443”; ma=86400, h3-29=“:443”; ma=86400  
**06-26 11:54:31.503 25463 26011 I okhttp.OkHttpClient: Unauthorized**  
06-26 11:54:31.503 25463 26011 I okhttp.OkHttpClient: ← END HTTP (12-byte body)  
06-26 11:54:31.507 25463 26011 E com.auth0.guardian.sample.DialogCallback: Guardian error  
06-26 11:54:31.507 25463 26011 E com.auth0.guardian.sample.DialogCallback: com.auth0.android.guardian.sdk.GuardianException: Error parsing server error response  
06-26 11:54:31.507 25463 26011 E com.auth0.guardian.sample.DialogCallback: at com.auth0.android.guardian.sdk.networking.Request.exceptionFromErrorResponse(Request.java:191)

**It seems https://MY\_TENANT\_NAME.auth0.com/api/enroll endpoint is not authenticated.**  
**I see a similar issues in the github, but those has not resolved.**

> <https://github.com/auth0/Guardian.Android/issues/97>
>
> Hi there,
> 
> I may be doing something silly here, but I've cloned the sample app… and library, and can't get an enrolment to work.
> 
> When a barcode is scanned, the Guardian library performs a call to https://mytenantishere.guardian.auth0.com/api/enroll
> 
> This call always returns a 401 with "Missing authentication", error code invalid\_token.
> 
> content-type: application/json; charset=utf-8
> D/OkHttp: content-length: 104
> www-authenticate: Ticket
> D/OkHttp: {"statusCode":401,"error":"Unauthorized","message":"Missing authentication","errorCode":"invalid\_token"}

> <https://github.com/auth0/Guardian.Android/issues/90>
>
> Hi there,
> 
> I may be doing something silly here, but I've cloned the sample app… and library, and can't get an enrolment to work. The tenant is configured with Guardian enabled and I've also entered the custom SNS settings for Amazon etc. I've also updated firebase configuration and the guardian.xml resource file with the tenant name.
> 
> When a barcode is scanned, the Guardian library performs a call to https://mytenantishere.guardian.auth0.com/api/enroll 
> 
> This call always returns a 401 with "Missing authentication", error code invalid\_token.
> 
> D/OkHttp: \<-- 401 https://mytenanthere.auth0.com/api/enroll (843ms)
> date: Fri, 06 Sep 2019 16:02:54 GMT
> content-type: application/json; charset=utf-8
> D/OkHttp: content-length: 104
> www-authenticate: Ticket
> cache-control: no-cache
> D/OkHttp: {"statusCode":401,"error":"Unauthorized","message":"Missing authentication","errorCode":"invalid\_token"}
> 
> Any ideas?

Can some one help me on this ?

---

<div class="post-metadata">

**Author:** ![tharindu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tharindu/32/13837_2.png) [@tharindu](https://community.auth0.com/u/tharindu)\
**Post date:** [June 27, 2022, 1:02pm UTC](https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933/2 "2022-06-27T13:02:23Z")

</div>

The Guardian URL in t src/main/res/values/guardian.xml. It should look like this https://\<YOUR\_TENANT\>.guardian.us.auth0.com

not

https://\<YOUR\_TENANT\>.guardian.auth0.com

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 1:27pm UTC](https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933/3 "2022-07-28T13:27:26Z")

</div>

Glad you have sorted it out and thanks for sharing with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 1:27pm UTC](https://community.auth0.com/t/enrolment-fails-in-android-guardian-sdk-sample-app/85933/4 "2022-07-28T13:27:30Z")

</div>


