# Building a Rack Middleware

DevFeed: [Building a Rack Middleware](<https://devfeed.tech/articles/building-a-rack-middleware-1316.md>)

Original publisher: [Read original article](<https://shopify.engineering/building-a-rack-middleware>)

Author: Shopify Engineering

Published: 2013-09-04T20:46:00Z

Content type: tutorial

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [Authentication](<https://devfeed.tech/topics/authentication.md>), [Sanitization](<https://devfeed.tech/topics/sanitization.md>), [Forms](<https://devfeed.tech/topics/forms.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [authentication](<https://devfeed.tech/tags/authentication.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [forms](<https://devfeed.tech/tags/forms.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [shopify](<https://devfeed.tech/tags/shopify.md>)

## AI overview

A Shopify developer describes an authentication-related bug caused by invalid form submissions in an application. The article explains how a Rack middleware placed before OmniAuth can sanitize or reject malformed shop data and outlines a strategy-based implementation approach.

## Source excerpt

I'm Chris Saunders, one of Shopify's developers. I like to keep journal entries about the problems I run into while working on the various codebases within the company. Recently we ran into a issue with authentication in one of our applications and as a result I ended up learning a bit about Rack middleware. I feel that the experience was worth sharing with the world at large so here's is a rough transcription of my entry. Enjoy!