GithubHelp home page GithubHelp logo

crud_user_api_jwt_net's Introduction

Exercise Instructions Before name of directory NS804

For this exercise, we would require .net 4.7.2 WebAPI2 framework.

Deliver a restful service that provides a registration,

  1. login
  2. crud services for a user.
  3. Fields: User will have to support
    1. first name, last name, phone, email, and address of street, city, state, zip.
  4. We wish to see correct use of
    1. http verbs,
    2. validation,
    3. exception handling,
    4. jwt,
    5. and. user responses for successful and error responses
    6. Create code structure for
      1. controllers,
      2. logic,
      3. and data,
  5. and unit tests for at least the logic.

To submit this exercise, please create a free repository on GitHub and share the link to this repository with us. You can create an account via this link: https://github.com/michaeljav/NS804.git

Solution:

TECHNICAL SPECIFICATIONS FOR DEVELOPMENT

  1. Data Base

    1. Sql Server Management Studio v17.4
    2. Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Standard 6.3 (Build 14393: ) (Hypervisor)
  2. Rest API

    1. Visual Studio Community 2017 Version 15.9.23
    2. Framework: .NET 4.7.2 WebAPI2
    3. EntityFramework 6
    4. EntityFrameworkCore.Tools 5.0.8
    5. Tokens.Jwt, Version=6.12.2.0
    6. Postman collection examples v2.1

STEPS TO START THE PROJECT

  1. Data Base
    1. Run the following Scripts
      1. Script to create Data Base, Table, and Insert data for user testing: 1.DataBaseScript \ CreateDataBaseWithDataExample.sql
      2. “User”: mjavier | “Password”: 187b7b2514961e1141b6eef7f70f355c
      3. “Note”: The password is encrypted with MD5
  2. Rest API
    1. Insert Database Connection Credentials (“Server, User, Password”) in API, located in file “Web.config” in the tag “connectionStrings” .
    2. Run Rest API service located in folder: *…* WebAPI2
    3. EndPoint List.- Can be tested by POSTMAN application
      1. GET, List of registered users. you don't need to authenticate with jwt token: http://localhost:1202/api/user/all
      2. GET, Search for a user by id. you don't need to authenticate with jwt token: http://localhost:1202/api/user/1
      3. POST, Create a user. you don't need to authenticate with jwt token: http://localhost:1202/api/user
        1. Body à raw:

{

"use_UserName": "mjavier",

"use_Password": "187b7b2514961e1141b6eef7f70f355c",

"use_FirstName": "Michael",

"use_LastName": "Javier Mota",

"use_Phone": null,

"use_email": null,

"use_AddressOfStreet": null,

"use_City": null,

"use_State": null,

"use_Zip": null,

"use_IsActive": true

}

  1. POST, Perform authentication to obtain the TOKEN JWT : http://localhost:1202/api/login/authenticate
    1. Body à raw:

{

"username": "mjavier",

"password": "187b7b2514961e1141b6eef7f70f355c"

}

  1. PUT, to modify the user. you need to authenticate with jwt token: http://localhost:1202/api/user/6
    1. Id User … api/user/<6>
    2. Body à raw:

{

"use_UserName": "mjavier",

"use_Password": "e10adc3949ba59abbe56e057f20f883e",

"use_FirstName": "Modificado",

"use_LastName": "Amador",

"use_Phone": 232323,

"use_email": "[email protected]",

"use_AddressOfStreet": "street",

"use_City": "city",

"use_State": "state",

"use_Zip": "zip",

"use_IsActive": true

}

  1. Headers

    1. KEY”: Authorization “VALUE”:<TOKEN GENERADO EJ: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VJZCI6IjMiLCJuYmYiOjE2MjgyNjA4NTIsImV4cCI6MTYyOTk4ODg1MiwiaWF0IjoxNjI4MjYwODUyfQ.NYwVx56O9fcOb159pYHN6_h5Xr6OrE183H4CyJ1vtIQ>
  2. DELETE, Delete User: http://localhost:1202/api/user/6

    1. Id User … api/user/<6>
    2. Headers
      1. KEY”: Authorization “VALUE”:<TOKEN GENERADO EJ: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VJZCI6IjMiLCJuYmYiOjE2MjgyNjA4NTIsImV4cCI6MTYyOTk4ODg1MiwiaWF0IjoxNjI4MjYwODUyfQ.NYwVx56O9fcOb159pYHN6_h5Xr6OrE183H4CyJ1vtIQ>

crud_user_api_jwt_net's People

Contributors

michaeljav avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.