123456789101112131415161718192021222324252627282930 |
- using System.Collections.Generic;
- using System.Web.Http;
- using Authentication_test.DBO;
- using iiie.Authentication.Business;
- using iiie.Authentication.Business.JWT;
-
- namespace Authentication_test.Controllers
- {
- public class ValuesController : ApiController
- {
- [AuthFilter((int)UserRoles.Root)]
- public IEnumerable<string> Get()
- {
- return new [] { "value1", "value2" };
- }
-
- [AuthFilter((int)UserRoles.NotRoot)]
- public string Get(int id)
- {
- return "value";
- }
-
- [Route("api/login")]
- [HttpGet]
- public string Login(string username)
- {
- return TokenManager.GetToken(username, "");
- }
- }
- }
|