0

So I want to make an authentication attribute that I can put on my methods. Example

[Attribute]
    public void getUsers()
    {

    }

I want the attribute to have some logic in it, so I can verify the information coming in, to see if the user is allowed to access that method. I have done a lot of searching and a lot of them use .Net or mvc and I want .netcore. Any help is welcome

Lionel
  • 31
  • 8
  • 1
    Possible duplicate of (https://stackoverflow.com/questions/31464359/how-do-you-create-a-custom-authorizeattribute-in-asp-net-core) – Ryan Wilson Aug 13 '18 at 17:57
  • What do you mean by **if the user is allowed to access that method**? You could try `IAuthorizationFilter` to check `User Claims`, you could place your logic in `IAuthorizationFilter`. What is the issue to use with the suggestion from Ryan. – Edward Aug 14 '18 at 05:45

0 Answers0