Earlier this month I attended the Codemash developers conference at the Kalahari Waterpark in Sandusky, OH. This was my 11th time going to the conference and I always come back with a list of things I want to learn more about. This year was no different and overall it was probably the best one I have attended. Following are a few of the more interesting sessions I attended.
This was full day workshop that went through in detail a typical API architecture written in .NET Core and including other common packages for Dependency Injection (Autofac), Testing (XUnit), Logging (SeriLog), Mocking (Moq), API Documentation (Swagger), Object Mapping (AutoMapper), plus a working example of using MongoDB with .NET Core. Lots of good takeaways from this.
Although Docker is not new, I have not really done anything with it before. This ½ day session included an AWS instance with the prerequisites already setup so we were able to go over creating a Docker image, and using DockerHub to find existing images to work with. It was a perfect to getting-started workshop for my level of Docker experience.
This session, in addition to the Docker pre-compiler, went over some cool uses of Docker images. The most interesting one to me was where the speaker described how each night that take a backup of the their production database, scrub the data of private information, and update an internal Docker image with the database backup. Then each morning all of the developers can pull the new image and do their development with data that is essentially production data.
These were two separate sessions but they are very much related technologies. Service Workers are a key part of Progress Web Apps. I have many years of web development experience and PWA’s are something I have been interested in learning more about. The PWA session was a great introduction and included details on when a PWA is the appropriate choice for an app, and a lot of good examples on how to setup a PWA.
Overall I feel like the time at Codemash was well spent and as usual I have a list of new tech to on my list of things to learn more about this year.
In my last post, I discussed how to setup JWT’s in ASP.NET Core 2. In this post, I’ll extend that example, adding the ability to refresh the JWT when it expires (i.e. refresh tokens). A refresh token will be returned with the JWT when the user logs in. And this new token will be used to refresh the JWT when it expires. We’ll simply create another middleware that handle’s the refresh token.
Continuing from my previous post, I’ll add refresh tokens to the application. The source code for this demo can be found here. Continue reading “Token Based Auth in ASP.NET Core 2 Part 2: Refresh Tokens”
ASP.Net Core 2.0 came out recently and there were quite a few changes to the authentication scheme. In this article, I’ll talk about how to setup token based authentication using JWT’s in ASP.Net Core 2.0. We’ll use the Identity system to handle authentication, and Entity Framework to access an MS SQL backend. NOTE: you will probably need to install the .Net Core 2.0 Libraries.
The source code for this can be found here. Continue reading “Token Based Authentication Using Asp.Net Core 2.0”
In Part 1 we setup basic token authentication using JWT’s with asp.net. Things are setup reasonably but all is not well. As a developer, you could give the token a lifespan of 30 days and just force the user to re-login after those days but what if you make the user inactive and don’t want him to login anymore? There must be better way.
Generally, I token has a lifetime of about an hour and when it expires, we want to refresh that token, verifying that the user still has access to the system, etc. The method that this is handled is using refresh tokens. A refresh token is returned along with the normal token and it’s stored for when we must refresh normal token.
Starting from our previous app, let’s support refresh tokens. Note, the completed code for this blog can be found here.
This will require us to track refresh tokens in our database, so first, let’s create the RefreshToken model.
On Thursday, I traveled to the TechSmith Corporation in the Lansing, Michigan area to deliver a presentation about .NET Core, Microsoft’s newest open source cross-compatibility framework.
At the presentation, I discussed some of the platform’s features and functionality, such as dependency injection, logging, user roles/identities, and use cases.
Continue reading “IBS Solutions Group Presents .NET Core to Development User Group in Lansing, MI”
For the second Codemash pre-compiler day I spent the full day working on the Humanitarian Toolbox project @htbox) with Bill Wagner (@billwagner) and Tony Surma (@tonysurma) and 5 other developers.
What is it?
The Humanitarian Toolbox is an open source non-profit organization, that creates software for disaster response teams. To kick things off, Tony gave us an overview of the projects and we pulled the code from GitHub.
Continue reading “Codemash 2016 – Humanitarian Toolbox”