I have a build in VB.NET as ASP.NET (.NET Framework) so it's not a CORE application.
The web site has lot's of API's build in WebApi 2 inside it and now I was going to make an authentication API via JWT, actually I have yet a Controller which return JWT token but now I have to validate it...
As I've read on the web I have to validate it throw a middleware like OWIN so I need to add the following method inside Startup class:
Public Class Startup
Public Sub Configuration(ByVal app As IAppBuilder)
app.UseJwtBearerAuthentication(New JwtBearerAuthenticationOptions With {
.AuthenticationMode = AuthenticationMode.Active,
.TokenValidationParameters = New TokenValidationParameters() With {
.ValidateIssuer = True,
.ValidateAudience = True,
.ValidateIssuerSigningKey = True,
.ValidIssuer = "url",
.ValidAudience = "url",
.IssuerSigningKey = New SymmetricSecurityKey(Encoding.UTF8.GetBytes("my_secret_key_12345"))
}
})
End Sub
End Class
But the issue is that by right-clicking the project and by > adding new element the Startup class doesn't exist...
So how can I create one? As I've read the project must be .NET Core to use Owin Startup class.. so should I rebuild all my project in Core or I can anyway find a way to authenticate JWT token without it?