Git Product home page Git Product logo

apiboilerplate's Introduction

Hi there ๐Ÿ‘‹

I'm Vince and I work as a Solutions Architect. Iโ€™m very passionate about learning new technologies and ideas, I enjoy tackling challenges and sharing what I learned in the technical community through writing articles, books and answering to forums. I have over 18 years of software engineering experience - years of making mistakes and learning from them. 11-time Microsoft MVP, 5-time C# Corner MVP, CodeProject MVP, MVA, MVA, OSS Contributor, Microsoft Influencer, DZone MVB and a regular contributor at various online technical communities.

Microsoft MVP | CodeProject MVP | CodeProject MVA | CodeProject MVE | CsharpCorner MVP

  • ๐Ÿ“ I write technical articles related to ASP.NET CORE, .NET 5 and Azure on my blog. Feel free to subscribe and get the latest posts delivered right to your inbox!
  • ๐Ÿ”ญ Iโ€™m currently working on a new open-source project template for ASP.NET Core APIs. Stay tuned!
  • ๐Ÿ“˜ The recent book that I coauthored is out. Check it out here: ASP.NET Core 5 for Beginners.
  • โ˜๏ธ Iโ€™m currently learning Azure and Cloud stuff.
  • ๐Ÿฆ Follow me on twitter @vmsdurano
  • ๐Ÿ”— Let's connect on linkedin
  • ๐Ÿซ I'm an All-Star member at Microsoft ASP.NET forums (100k+ rep), Legend member at CodeProject (72k+ rep) and Platinum member at C# Corner (15k+ rep)

๐Ÿ“š Books written:

apiboilerplate's People

Contributors

brunao05 avatar judedaryl avatar proudmonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apiboilerplate's Issues

Suggestion for new version

Some personal opinions after having used this template for a new API.

For the new version of this BoilerPlate I would suggest not including so much "extras", at least not extras that are enabled by default. While it might be useful, it has the side effect of turning this boilerplate template more into a code sample/tutorial than something you can use to get a quick start. This as you would have to spend about as much time trying to understand how those extras work as well as removing them if you don't use it, as it would take to configure a new API from scratch and configure health checks etc.

I think this might turn away potential users of this excellent template, that really offers a lot of value. Well, that's my personal opinions, others might disagree :)

Can we add support for JWT Auth scheme and related configuration with Authroization Role, Police, permisssion etc

Can we add support for JWT Auth scheme and related configuration with Authorization Role, Police, permission etc.

ApiBoilerPlate project template is very good and has lots of things which required for most projects.

As most of the project is using username and password and based on that they generate JWT Token.
However in provided sample it's using API key and secret which is only used for one client it can be used as daemon service As per my understanding.

For API Project most people are not using IdentityServer due to lots of complexity and configuration instead use custom or dotnetcore identity authentication with JWT scheme for API Project.

Swagger authorization not working (401 error)

First, THANK YOU for creating and sharing the template.

Background: The ApiBoilerPlate was used to generate a WebAPI project. After adding [Authorize] attribute to the PersonsController, the endpoints require to Bearer JWT access token as expected. However, accessing any endpoint in the PersonsController will get 401.

Issue - Para authorization and bearer token are not included in the header upon submit in Swagger. External testing using Postman worked fine.

Fix - Made the following changes in Infrastructure\Installers\RegisterSwagger.cs

            options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
            {
                Scheme = "Bearer",
                Description = "Enter 'Bearer' following by space and JWT.",
                Name = "Authorization",
                //Type = SecuritySchemeType.Http,
                Type = SecuritySchemeType.ApiKey,
                In = ParameterLocation.Header,
            });

See below for the code -
https://github.com/workcontrolgit/EmployeeProfileWebAPIDemo/blob/master/EmployeeProfile/EmployeeProfile/Infrastructure/Installers/RegisterSwagger.cs

I will fork and submit a pull request.

.NET 6 ApiBoilerPlate

Vincent,
Happy New year 2022, I have same questions as others, is there a plan to update this to .NET 6 ?

When I run the project I get the error in browser (HTTP Error 500.24)

I have installed the template form extensions menu of visual studio and created a new project. I also created a table in my database and updated the connection string in appSettings.json file. when i run the project i see the following error in my browser as shown in the image.

HTTP Error 500.24 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Most likely causes:
system.web/identity@impersonate is set to true.

Things you can try:
If the application supports it, disable client impersonation.
If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false.

Capture asp netboilerplate error

Runtime problem after updating AspNetCoreRateLimit to 4.0+ (with solution)

If you run into problems like this after updating AspNetCoreRateLimit (or have it updated for you by another NuGet package):

System.InvalidOperationException: Unable to resolve service for type 'AspNetCoreRateLimit.IProcessingStrategy' while attempting to activate 'AspNetCoreRateLimit.IpRateLimitMiddleware'.

This is the solution needed to get it working again:

        // See release notes for 4.0.0 https://github.com/stefanprodan/AspNetCoreRateLimit/releases
        services.AddSingleton<IProcessingStrategy, AsyncKeyLockProcessingStrategy>();

In RegisterRequestRateLimiter class

Add some detail on creating a service from the built API

Great effort! However, how do I create a Windows Service from the resultant exe file? Almost nowhere in the web that I can find, are there clear instructions for running a WebApi based on Net Core 3.1 as a Windows Service using either Kestrel or Http.Sys as the self host.
Our applications and WebAPIs have to be installed and run at our customers' sites and most tutorials and blogs that I can find provide little or no help with Publish and Deploy to third parties who may or may not have strong Devops skills. I have found some good ideas for changing the Program.cs to recognise if the app is running in debug mode or as a Windows Service, but these mostly apply to .Net Framework bases.
Can you add some information regarding this?

Usinng this with angular 2+

Hi, I would be grateful if you could show small sample on how to integrate this with an angular 2+ client application.

Thanks.

HealthChecksUI not start

I start the project and try to open HealthChecksUI. I don't see the UI.

"HealthChecksUI": { "HealthChecks": [ { "Name": "HTTP-Api-Basic", "Uri": "https://localhost:5001/selfcheck" } ], "Webhooks": [ { "Name": "", "Uri": "", "Payload": "", "RestoredPayload": "" } ], "EvaluationTimeInSeconds": 10, "MinimumSecondsBetweenFailureNotifications": 60, "HealthCheckDatabaseConnectionString": "Data Source=Infrastructure\\HealthChecks\\Db\\healthchecksdb" }

ActionResult not used

Hi,

How come ActionResult / Task< ActionResult > isn't used in this project but instead more direct approaches like Task? Just curious if there is a special reason for it?

Why is Microsoft.Extensions.Logging used instead of Serilog?

I've noticed that even though SeriLog is used in the projects, the usings are:

using Microsoft.Extensions.Logging;

instead of:

using Serilog

so that stuff like:

_logger = logger?.ForContext()

won't work.

Of course, you can change this in your own code (or the entire code if you want to) but I guess there is a reason for it being as it is?

Main reason for asking this is because we want to add custom Override to serilog like:

  "Override": {
    "Microsoft": "Warning",
    "System": "Warning",
    "System.Net.Http.HttpClient": "Information",
    "OurClassHere": "Debug"

and was not able to figure out how to do it which led us to this.

Thanks.

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.