Is there a way how I can check programmatically which user is used when my application accesses resources?