I am using the aad_oauth library in my Flutter app for Microsoft authentication. The authentication flow seems to work, but when I attempt to retrieve the refresh token, it returns null. Also I'm getting the access token and its expiry time
Here’s the relevant part of my code:
Future<Either<Failure, String>> msAADRefresh() async {
try {
final AadOAuth oauth = config;
final refreshToken = await oauth.refreshToken();
return refreshToken.fold((failure) => left(Failure()),
(token) => right(token.refreshToken.toString()));
} catch (e) {
return left(Failure(e.toString()));
}
Note: I have attached all my config in config variable. I'm able to logged in but not getting the refresh token.


offline_accessin the scopes when initializing the AadOAuth instance to get the refresh token.