Example #1
0
 public AccountController(
     IUserService userService,
     IMapper mapper,
     IOptions <JwtSecretKey> jwtSecretKey)
 {
     _userService  = userService;
     _mapper       = mapper;
     _jwtSecretKey = jwtSecretKey.Value;
 }
Example #2
0
        public ActionResult <string> Get()
        {
            var token = new JwtTokenBuilder(TokenType.Password,
                                            JwtSecretKey.Create("allegrosecretkey"),
                                            "Allegro Authentication",
                                            "Allegro.Authentication",
                                            "Allegro.Authentication")

                        .AddClaims <Payload>(new Payload
            {
                UserId   = 1,
                UserName = "******",
                Email    = "*****@*****.**",
                FullName = "Ronald Sepuntos",
            })
                        .AddScope(new List <string> {
                "urn:allegro:tasks:getany", "urn:allegro:tasks:getany"
            })
                        .Build();

            return(token.Value);
        }