poniedziałek, 3 czerwca 2013

TIP: Testing OAuth on Android emulator

Recently I was testing OAuth on two different Android emulators. One of them was running Android Jelly Bean and second Gingerbread.
I was testing obtaining token from the server with simple junit. Everything was working like a charm on Jelly Bean but Gingerbread was receiving from the server response 401 - Unauthorized.
Response from the server was meaningless without any additional description. Fortunately, I was able to debug the server and I have found out that timestamp verification failed. It turned out that OAuth Jersey library accepts requests with max age 300000 milis(5min). Moreover, Gingerbread emulator had wrong date, it was too old.
Setting date on emulator to current date - same as on the server - fixed the problem.

It's really time consuming issue if you don't know the reason, so my suggestion is to update your testing checklist before you jump into AOuth testing.

Brak komentarzy :

Prześlij komentarz