WebService REST with authentication [ID, CPF, User, Password]

0

Hello, I have been searching the web for some time but I can not find clear answers.

I want to implement a webservice rest, with tokens and etc for security, and the webservice consists of just GET for queries with our SQL Server, but I'm having difficulty generating an authentication that needs 4 parameters, which are id, cpf , username and password.

Then the path would be as follows: The user logs in to the App with the 4 parameters, hits the authentication on the server, generates the token that will be reused so that the login in the app is persistent and thus can make GET requests to get information about your system ..

The project has to be in .NET 4.5 and we are creating it by Visual Studio 2015.

Could someone tell me a good place to learn about it, or give a little of your minutes to write me a good answer?

    
asked by anonymous 27.01.2018 / 15:22

1 answer

0

To register my solution, I created a "Login" model that contained all the information required for the call on my Controller with the FromBody parameter.

public HttpResponseMessage Post([FromBody]Login param)
{
    //TODO
}

From there, all POST requests to WebApi would be complemented with the parameters (Json) to the Login model, so I could use all the necessary fields for my methods.

    
01.02.2018 / 16:13