Sample ASP.NET Web API project with OAuth authentication and many other extensions.
1. The basics of API (GoodNotesController)
- Create -> Post
- Read -> Get
- Update -> Put
- Delete -> Delete
- Basic validation (via DataAnnotations attributes)
- ModelState validation (ValidateModelStateAttribute)
- Model empty validation (CheckModelForNullAttribute)
- Action parameters validation (ActionParametersValidationAttribute)
- Access Token (OAuth bearer token authentication using OWIN middleware) (SimpleAuthorizationServerProvider)
- Client credentials validation
- Token custom parameter
- Authentication Ticket custom property
- Custom claim
- Refresh Token (SimpleRefreshTokenProvider)
- Custom Authorize attribute (SimpleAuthorizeAttribute)
- Dependency Injection with Autofac (DependencyConfig)
- API documentation page with Swagger (SwaggerConfig)
- API exceptions handling (RequestExceptionAttribute)
- Working CORS (Cross-Origin Resource Sharing) implementation (CorsProvider)
- Simple Owin middleware to rewrite header from request to response (CorrelationIdHeaderRewriterMiddleware)
- HTTP Status Codes: https://www.restapitutorial.com/httpstatuscodes.html
- Choosing an HTTP Status Code:
http://racksburg.com/choosing-an-http-status-codehttps://www.ruilog.com/notebook/view/f21862318f93.html