Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [AcceptVerbs("POST")]
- [HttpPost]
- public string Post([FromBody]User user)
- {
- if(user.Username == "hello" && user.Password == "123")
- {
- var accessTokenResponse = GenerateLocalAccessTokenResponse(user.Username);
- return accessTokenResponse.ToString();
- }
- else
- {
- return "User invalid";
- }
- }
- [Authorize]
- [HttpGet]
- // GET api/orders/5
- public string Get()
- {
- return "This is a secure resource";
- }
Add Comment
Please, Sign In to add comment