Since you are the prefix lines of your domain / user and domain / group with the @ symbol, you do not need to double the escape slash. You can try replacing these lines:
[Authorize(Roles="MyDomain\\company.security.group.name")] [Authorize(Users="MyDoamin\\MyName")]
or
[Authorize( Roles=@ "MyDomain\company.security.group.name")] [Authorize( Users=@ "MyDoamin\MyName")]
A few additional readings also showed that the authorization filter will check for βusersβ and βrolesβ. If the user does not meet both requirements, they will be denied access.
To get the behavior you need, you will need to write a custom authorization filter, as suggested in the previous answer.
source share