Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var tokenConfig = new TokenConfig();

            Configuration.GetSection("JWT").Bind(tokenConfig);

            services.AddSingleton <TokenConfig>(tokenConfig);

            services.AddSingleton <ITokenHelper, TokenHelper>();

            services.AddMvc(opt =>
            {
                opt.EnableEndpointRouting = false;
            });
        }
Exemplo n.º 2
0
 public TokenHelper(TokenConfig tokenConfig)
 {
     this.tokenConfig = tokenConfig;
 }