Two-speed IT

by Jannik Arndt

The Problem

You’re a corporation. Your IT department is old, slow and can’t innovate. Your competitor however can. So you try what every corporation tries: Two-speed IT.

The solution

It’s easy: You take the best employees from every department, put them together, give them the highest priority and a lot of funding. Kind of like a startup, but with corporate money.

The catch

You’re a corporation. You don’t have good employees. You drove them away years ago, with your processes and hierarchies. You only have employees who suck less then the others.

The solution

You hire a bunch of consultants, so your people can tell them to innovate.

The catch

You’re a corporation, remember? You don’t have good employees. You have people who are good with processes and hierarchies. They will inevitably build the only thing they know: An old, slow department that can’t innovate, with processes, hierarchies and consultants. Also, you have deprived your actual IT department of its best employees.

Blog


I recently created a wonderful bug.




This is a basic example how to implement oAuth2 using Akka HTTP and Scala. It provides three endpoints. From the clients point of view:

  • / — publicly accessible, returns “Welcome!”,
  • /auth — provide your username and password, receive an access_token in return,
  • /api — secured by oAuth, send the access_token in a header to gain access.

From the server’s point of view:

  • / — publicly accessible, do nothing,
  • /auth — receive basic auth credentials, verify they’re in the list of known credentials, create an access_token, return it,
  • /api — receive authorization header, check if access_token is in list of valid tokens.

Since oAuth tokens are short lived, the server also has to invalidate expired tokens.




Getting a Akka HTTP-based backend up and running on Heroku for free can be done in less then 30 minutes — if you know the tricks.