flutter_appauth
flutter_appauth copied to clipboard
accessTokenExpirationDateTime is Null for iOS but returns a value for Android
First of all, thank you for making this wonderful plugin!
Issue Faced: We're using ROPC to get a token using AppAuth and it works well. However, we are receiving accessTokenExpirationDateTime as null on iOS platform but on Android it is returning expected value.
Code
final TokenResponse result = await appAuth.token(tokenRequest); //where token request contains all the parameters and scopes
accessToken = result.accessToken;
tokenLife = result.accessTokenExpirationDateTime; //returns null on iOS but expected value on Android
We are using Azure B2C.
This isn't something I can look into and haven't seen this with using the authorisation code grant. The code for parsing this info is pretty standard and I wouldn't have expected an issue to occur based on the grant type or for it to differ based on the platform.
As you have access to a server using ROPC, I would suggest you debug this and submit a PR if you have indeed found an issue with the plugin.
Yeah, I agree! For now, I will debug and try to find out why from my end as you said
@okayfine we experienced the same issue, having to the with the token returned by the server. expires_in
must be a number as per RFC6749, but it was returned as string. The Android plugin handled this, while iOS did not and put it in the additionalParameters
map.