Basic Authentication in Rest API (C #) [closed]

-1

I have an application made in ASP.MVC where I implemented ASP.NET Identity for user registration / login.

Now I have to create a Web API Rest with a simple authentication, only a single user and a unique password.

Can anyone give some tips how to implement this basic authentication in the Web API?

Thank you

    
asked by anonymous 05.03.2017 / 22:56

1 answer

-1

You have to add the following field to the HTTP header

Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

where QWxhZGRpbjpPcGVuU2VzYW1l is the base64 encoded user and password.

Please be aware that your password security is zero. Anyone can right click on the browser and see the headers ... the password will be there encoded in base64, and qqer one can decode this ...

Anyway ... good luck;)

    
05.03.2017 / 23:51