flutter_appauth icon indicating copy to clipboard operation
flutter_appauth copied to clipboard

accessTokenExpirationDateTime is Null for iOS but returns a value for Android

Open okayfine opened this issue 4 years ago • 3 comments

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. Screen Shot 2020-11-15 at 3 04 49 PM Screen Shot 2020-11-15 at 3 04 31 PM

okayfine avatar Nov 15 '20 11:11 okayfine

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.

MaikuB avatar Nov 21 '20 01:11 MaikuB

Yeah, I agree! For now, I will debug and try to find out why from my end as you said

okayfine avatar Nov 22 '20 08:11 okayfine

@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.

naeramarth7 avatar Mar 22 '21 16:03 naeramarth7