-
Notifications
You must be signed in to change notification settings - Fork 1
Home
It's a simple way for you to generate tokens and authenticate using JWT.
JWT.Service implements a static method for generating tokens, making your code leaner. In this method, the secret key of your application that will later authenticate in the token is passed as a parameter.
In this method you are required to pass the user ID, the application's secret key and the token expiration time in hours as a parameter.
TokenService.GenerateToken (user.Id.ToString (), "CHAVESEC52", 6);
In this method, it is required that you pass the application service in the API as a parameter, located in the Startup.cs class and the secret key for the respective authentication. It is also possible to pass some additional parameters for authentication of the token which is at the discretion of the developer.
JWTService.Authentication (services, "CHAVESEC52");