I have applied Conditional Access policy in Azure AD for some users to block access to Microsoft Teams. But I still need to have access to Teams from my Web Service within refresh token (to post some data on behalf of that user).
When I am trying to refresh token for user that appear in that list, I retrieve following error:
AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance.
.
I have tried to add Location Condition to allow to access Teams only from my server's IP address. I can access Teams from browser installed in server (I could not access from another computer), but this error still reproduced.
How could I resolve that and block access to Teams but still have an ability to refresh tokens and act on behalf of that user within my Web Service?