You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
using Owin;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Configuration;
|
|
|
|
namespace OnDocAPI_NetFramework
|
|
{
|
|
public class Startup
|
|
{
|
|
public void Configuration(IAppBuilder app)
|
|
{
|
|
app.UseJwtBearerAuthentication(
|
|
new JwtBearerAuthenticationOptions
|
|
{
|
|
AuthenticationMode = AuthenticationMode.Active,
|
|
TokenValidationParameters = new TokenValidationParameters()
|
|
{
|
|
ValidateIssuer = true,
|
|
ValidateAudience = true,
|
|
ValidateIssuerSigningKey = true,
|
|
ValidIssuer = ConfigurationManager.AppSettings["JwtIssuer"], //some string, normally web url,
|
|
ValidAudience = ConfigurationManager.AppSettings["JwtIssuer"],
|
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(ConfigurationManager.AppSettings["JwtKey"]))
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} |