Codemash 2018: Drone Racing

AJThis year at Codemash I thought it’d be fun to do a “precompiler” session (aka an in-depth session before the conference gets started), despite the fact it may not specifically help in my software development area. But I hadn’t done any sort of embedded systems work since college and I thought this would be a great opportunity to get back into it.

As you may know, drone racing has been picking up a lot of steam lately. In fact, they’re even broadcasting it on ESPN these days. It’s actually very exciting to watch: Drones fly at impressive speeds through complex courses that require an amazing amount of maneuverability that takes nothing less than a wiz to handle.

Continue reading “Codemash 2018: Drone Racing”

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 Using Asp.Net Core 2.0

ASP.Net Core 2.0 came out recently and there were quite a few changes to the AJauthentication 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”

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”

Token Based Authentication in ASP.Net using JWTs Part 1

AJLately, I’ve been doing quite a bit of front-end development with the latest version of Angular and that requires token based authentication. So in this article let’s discuss how to create tokens in .Net.  I’ll go over setting up tokens in regular .Net, and in a later article, I’ll discuss how to setup tokens in .Net core.

All of the code can be obtained from Github Here.

Continue reading “Token Based Authentication in ASP.Net using JWTs Part 1”

Evaluating HTML5/Angular Data Grid

misc1I’m implementing sorting, filtering, and grouping for a data set to allow business users to look at information in various ways for more comprehensive data analysis. By using a pre-built component, time is saved by reducing development time for implementing the feature.  This is replaced by configuring and adding logic for the grid to work. I tried out a few different data grids to see how they might meet my needs:

UI-grid

  • Control selected/displayed columns
    • Must manually load / save user selected columns (implemented on other tables)
  • Column Filtering
    • If we limit the result set and do NOT use pagination, then we can use filters inside the grid:
      • Supports less-than and greater-than — need to be in separate inputs
      • Dates need to be typed in by hand (and need to specify format) or create a custom date filter
  • Saving/Loading Filters     
    • The filters store the column data like “grid.column[i].filters[0]” so it would be pretty easy to store that data to a database and then pre-populate back
  • Exporting
  • Pagination
    • Painful but possible with the filters and just passing them to the server and handling them individually
  • Printing
    • Export to pdf and print


Dev Express Grid

  • Control selected/displayed columns
    • This will be a manual process as well (combining this with the ‘visible’ properties on the columns)
  • Column Filtering
    • Again, we would want to NOT use pagination and just limit the result set
    • Contains built-in equality operators
  • Saving/Loading Filters
    • I’m having difficulty finding out how to do this.  It seems that this is close
  • Exporting
  • Pagination
    • They only have simple pagination samples, none containing filters
  • Printing
    • Export to excel and print
    • Export to pdf on server (or client)

Telerik KendoUI DataGrid

Note: although this seems like a fully-functional datagrid, it’s hard to find examples for angularjs.  It seems most are plain javascript.

  • Control Selected/Displayed columns
    • Must be handled manually (like all others)
  • Column Filtering
  • Saving/loading filters
  • Exporting:
    • Exports to PDF
    • Exports to Excel
  • Pagination
    • They only have simple pagination samples, none containing filters
  • Printing
    • Export to pdf and open then print

 

Printing seems to be the biggest issue across all three of these data grids. UI-Grid can do CSV and pdf in Chrome, DevX Grid can do Excel only). Up next, I’m looking to do the following:

Setup Xamarin iOS to Login to Azure ADAL and Sharepoint Online

misc1This project takes a lot from this and makes changes for the new API (you must register your SharePoint application with Azure AD).  This document sets up Azure AD for Sharepoint Online.

When using the ADAL package on the Xamarin iPhone emulator, it requires quite a process to get up and running.  Installing ADAL requires the NuGet Package  “Microsoft.IdentityModel.Clients.ActiveDirectory”. Once that’s installed, you must create an authenticator service to assist with authenticating.

Continue reading “Setup Xamarin iOS to Login to Azure ADAL and Sharepoint Online”