auth0 / Guardian.Android

Android toolkit for Auth0 Guardian API
https://auth0.com/guardian
MIT License
5 stars 16 forks source link

Allowing/Rejecting always fails #89

Open jcyu0208 opened 5 years ago

jcyu0208 commented 5 years ago

As the title suggests allowing or rejecting a notification always fails with the following error:

GuardianException{{statusCode=401.0, error=Unauthorized, message=An error ocurred validating the challenge response token: jwt expired, errorCode=invalid_challenge}}

Not sure how to resolve this since the challenge is coming from the notification that I received.

santiagoaguiar commented 5 years ago

The error is returned by Auth0 when the token sent by the device has expired. This token gets expiration is set 30 seconds from the current time here: https://github.com/auth0/Guardian.Android/blob/276c2ff649f12510b4b1f7d1a5c6b012cba0a34b/guardian/src/main/java/com/auth0/android/guardian/sdk/GuardianAPIClient.java#L214

Could you check if the device clock is out of sync for more than 30 seconds? That could make the the verification fail in that case.

Thanks!