Token Based Auth in ASP.NET Core 2 Part 2: Refresh Tokens

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.AJ

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”

Token Based Authentication in ASP.Net using JWTs Part 2: Using Refresh Tokens

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.AJ

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.

Continue reading “Token Based Authentication in ASP.Net using JWTs Part 2: Using Refresh Tokens”

Office 365 Collaboration Confusion

A couple weeks ago, Microsoft held their annual Ignite conference and I would usually be blogging about all the cool new things coming to Office 365. This year has been a bit a different experience altogether, not for a lack of features announced from Microsoft though…there were plenty of awesome new features announced. We’ve spent the past couple weeks fielding questions on Office 365 from existing customers and folks looking to make the move or at least understand the options available.

Continue reading “Office 365 Collaboration Confusion”

Angular 2 Lunch & Learn

Rick HerrmannThis afternoon I’m leading a Lunch & Learn at IBS friend and client Total Quality Logistics. I’ll be teaching them everything I know about Angular 2 and how we’ve utilized it in projects over the past few months. Should be a lot of fun! I’ll follow up later today with more details on how the event went.

If YOU are interested in having me or someone else from Nerdia (aka the IBS Mobile & Web Solutions Group) come for lunch to teach your team about Angular 2, Git, SharePoint and more, fill out the form here.

Angular 2 – Testing

Rick HerrmannWriting tests has been something I’ve been a proponent of for many years.  My testing experience started with C# and then continued on the front end with javascript and Angular 1.  So when I started learning Angular 2, I naturally wanted to see what the testing story was.

The front-end testing I’ve done in the past has always had some friction with respect to getting the tools setup properly.  Mostly I have used Jasmine as the testing framework, which is pretty self contained – but to get a node test server setup properly there are a variety of other npm modules and karma configuration settings to deal with.  I previously wrote about how the angular-cli makes it easy to get an Angular 2 project setup, and this includes getting the test tools setup as well.  So instead of dealing with configuration settings, you can quickly get to just writing tests.

Continue reading “Angular 2 – Testing”

Angular 2 CLI

Rick HerrmannOne of the good things about Angular 1 was that it was easy to add the AngularJS library to your application and start using it without a lot of setup ceremony.  Add a <script> tag to pull in angular.js, stick an ng-app attribute on the body or html tag, and you were ready to go.  Of course, in a more complex application you would end up using additional libraries and probably setup a build process, but the barrier to getting started was low.

With Angular 2, getting started from scratch is not nearly as simple.  While there are multiple “starter-packs” that have been created to help with generating a ready-to-go project, the thing that has most caught my attention is the Angular CLI (command-line-interface).  Although the Angular CLI has not been officially released (it is in beta as of this writing), it already has a number of features that not only get you up and running quickly, they also help with adding other pieces of your application as it is developed.

Continue reading “Angular 2 CLI”

SharePoint Online Changes Are Coming…

Duane OdumOn August 31, 2016 Microsoft announced the newest capabilities coming to a SharePoint Online tenant near you…Modern Team Sites and Pages being of the most interest to yours truly.  So far Microsoft has done a really nice job of sticking to the roll out schedule announced at the May 4th event and that bodes well for the continued development of SharePoint moving forward.  Rather than rattle off all the improvements coming out I will just be linking to the announcement from Microsoft here and answering an open question posed by Wictor Wilen on Twitter (@wictor if you would like to give him a follow).  How do you think the new 25TB site collection limit will affect your SharePoint Designs and Architectures?

Continue reading “SharePoint Online Changes Are Coming…”