-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStartup.cs
32 lines (30 loc) · 1.08 KB
/
Startup.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.Owin;
using Owin;
using Microsoft.Owin.Security.Jwt;
using Microsoft.Owin.Security;
using Microsoft.IdentityModel.Tokens;
using System.Text;
[assembly: OwinStartup(typeof(Preveld.Startup))]
namespace Preveld
{
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 = "http://www.envisio.com.my", //some string, normally web url,
ValidAudience = "http://www.envisio.com.my",
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("aFYbvBTvbGJf65ur"))
}
});
}
}
}