All Blog Posts

Scheduling Hugo posts on Netlify

23 October 2017

I recently switched by blog over from Jekyll running on GitHub Pages, to Hugo running on Netlify. One of the things I investigated was how to schedule blog posts on Netlify. This is, as with most other Static Website Generators, not something which is supported out of the box due to the fact that these websites are not dynamic. The content is created when the static generator runs, so you need some way to re-generate the website at a future date and time to include those future-dated posts.

New Adventures

19 October 2017

It is time for new adventures. Over the past months, I have started feeling what seemed at the time like an unhappiness with my work. After reflecting on this for a while, I have realised that there was nothing inherent about the work at Auth0 which made me unhappy. It is a great company with great people, and the work is, for the most part, satisfying and challenging. Instead, I realised that I felt unhappy and frustrated because I am, in a sense, working on the wrong stuff.

Initial thoughts on the Lenovo X1 Carbon (5th Gen)

15 October 2017

I recently bought a Lenovo X1 Carbon (5th Generation) and after spending a little over a week with it, here are my initial thoughts of it as a software developer using Microsoft tools such as Visual Studio. My Requirements Before I start diving into my thoughts of the Lenovo X1, I want to spend a little time on my requirements. I am a software developer using primarily Microsoft tools such as Visual Studio and Visual Studio Code, as well as 3rd party IDEs like JetBrains Rider.

Forcing user to sign in with their Google Organization (G Suite) account

12 September 2017

Microsoft has a nice document explaining how to allow users to sign in to your application with their Google accounts. I was curious to see how one could go about forcing users to sign in with their organizational account. Why would you want to do this? Well, let say your company is using G Suite as its directory service. Only allowing users to sign in with their organizational (G Suite) email address means that you only have to procure users on the G Suite directory service.

Razor Pages tip: Define extra handlers for a Razor Page

10 September 2017

I have been tinkering with Razor Pages a little but, and had a requirement where I wanted to make an AJAX request to the server from a Razor Page. A Razor Page source file typically contains 2 handlers, namely OnGet and OnPost which handles GET and POST requests respectively: public class IndexModel : PageModel { public void OnGet() { // Process GET requests } public void OnPost() { // Process POST requests } } If the handler is an async method, you can also optionally use an Async suffix, for example:

How to exclude files from Git only on your computer

07 September 2017

At Auth0 we develop a lot of sample applications to show developers how to use our various features inside their applications. These applications invariably require some sort of configuration which is read from a file. For our Angular Quickstarts for example, there is a file called auth0-variables.ts.example which contains an example of the settings required for the application to run. When a user downloads or forks this example to run it locally, they need to simply rename that file to auth0-variables.

Tips for developing templates for dotnet new

05 September 2017

When creating a new project with the dotnet new command, you are offered a list of templates you can use. These templates allow you to quickly bootstrap a new application according to a specific configuration. There are for example templates to create an MVC application, a Razor application, an API etc. You can also install extra templates which have been created by other authors. You can discover these templates on the .

Using Visual Studio Code for C# (.NET Core) development

06 August 2017

Lately I have been using my Mac as my main daily driver. I still spin up Parallels from time to time when I need to do something inside Visual Studio, but for most of my C# work I use VS Code (and .NET Core). This blog post contain some notes about using VS Code for your C# and .NET Core development which may make your life easier. As a side note, I have also actually started looking seriously into JetBrains Rider as I miss the powerful refactoring capabilities from Resharper.

Accessing the OIDC tokens in ASP.NET Core 2.0

01 August 2017

Earlier the year I wrote a blog post which described how to access the JWT Bearer token when using ASP.NET Core 2.0. Though that was specifically for when using the JWT middleware, you could also use that technique when using the OIDC middleware. In ASP.NET Core 1.1 So for example, in ASP.NET Core 1.x, if you wanted to access the tokens (id_token, access_token and refresh_token) from your application, you could set the SaveTokens property when registering the OIDC middleware:

Overriding the NameClaimType when using the ASP.NET Core OpenID Connect middleware

30 May 2017

When using the ASP.NET Core OpenID Connect middleware, after a user has signed in you can access the name of the user by using the User.Identity.Name property. What this does under the cover is to look for the http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name claim type and then return that value. In the case of Auth0, we actually return a user’s name in the name claim of an id_token and this does not get automatically mapped to the http://schemas.