Basic For Web Api (Jwt Token , Consuming Method)
Steps For Creating Api
First we will get username and password.
And we encrpt the password using Encoding.UTF8.
Then we append it on model and convert it as Json.
pass the json to api to validate user
and api will return success status , jwt token ,
and response which contains username , access privilage menu details ,
profile path
Index
- Encrypt Password
- Call Api Method
- Https methods
- Return Status Codes
Encrypt Password
string strmsg = string.Empty;
byte[] encode = new byte[password.Length];
encode = Encoding.UTF8.GetBytes(password);
strmsg = Convert.ToBase64String(encode);
Https methods
- GET - Retrive
- POST - Insert
- PUT - Update Existing Record
- PATCH - Update Record Partially
- DELETE - Delete Records
Filter Type | Interface | Class | Description |
---|---|---|---|
Simple Filter | IFilter | - | Defines the methods that are used in a filter |
Action Filter | IActionFilter | ActionFilterAttribute | Used to add extra logic before or after action methods execute. |
Authentication Filter | IAuthenticationFilter | - | Used to force users or clients to be authenticated before action methods execute. |
Authorization Filter | IAuthorizationFilter | AuthorizationFilterAttribute | Used to restrict access to action methods to specific users or groups. |
Exception Filter | IExceptionFilter | ExceptionFilterAttribute | Used to handle all unhandled exception in Web API. |
Override Filter | IOverrideFilter | - | Used to customize the behaviour of other filter for individual action method. |
Comments
Post a Comment