Forum Libraries, Components, and Plugins

Problem when exchanging code for access token (only on Android).

Since I already made an issue on Github, and I didn't received any response there, I'll post it here as well to increase my chances. I'm currently with my hands in my hair with this problem. Anyway, it would be great if anyone can point me in some direction, since I don't have any clue. Anyway, my problem is with the Xamarin.Auth component on Android. The original issue is posted here and the original text is:

I'm not really sure if I found a bug or if it is another problem. I'm using this library in my Xamarin.iOS and my Xamarin.Android application. I have the following flow on both of my apps:

Im facing problems in the OAuth2 flow when I want to exchange my code for an access token.

We have two networks, where one of the networks is outside of the company network. When I'm on the company network, the process goes fine on the Android Emulator and when I'm on the outside network, the process goes fine ONLY on IOS. So, to sum up what I tested already:

Outside network

Device                      | Result                                                 |
----------------------------| -------------------------------------------------------|
Macbook (iOS simulator)     | Ok                                                     |
Macbook (Android simulator) | 400 Bad request while exchanging code for access token |
Android tablet              | 400 Bad request while exchanging code for access token |

Company network

Device                                        | Result                               |
----------------------------------------------| -------------------------------------|
Windows (Android emulator (Xamarin Player) )  | Ok
Windows (Android emulator (Genymotion) )      | Ok

I really don't know where to begin to debug this problem, because in all scenario's, they're using the same code OAuth2Authenticator:

Since I'm getting the Ok flow in both the outside and the company network, I'm suspecting this isn't a network issue.

I hope somebody can point me in the right direction!

Best regards

Sign In or Register to comment.