Im using this get request to check whether the user exists in my b2c tenant or not:
var url="https://graph.microsoft.com/v1.0/users?\$filter=signInNames/any(x:x/value eq 'test@auxi.com')&api-version=1.6";
final response = await client.get(url,headers:{ 'Authorization': 'Bearer $token'});
The token is the B2C token retrieved from the SignIn flow and I granted the "Directory.ReadWrite.All" permission for Microsoft Graph API in my app.
Based on this answer: https://stackoverflow.com/a/52289249/9576638
However Im getting this response when Im executing the query:
"error": {
"code": "InvalidAuthenticationToken",
"message": "Access token validation failure.",
"innerError": {
"date": "2020-11-29T18:47:03",
"request-id": "86cb2fe9-37b4-4060-8953-90748d6475aa",
"client-request-id": "86cb2fe9-37b4-4060-8953-90748d6475aa"
}
}
My aim is to check the whether the user's email is in the b2c tenant or not.. any help is appreciated.