I’m John C Bland II

Husband, Father, Tech Author, Deacon.
Founder of Katapult Media, and full-stack polyglot developer.
Political Free Agents Podcast Host.

I create. I launch.

YouTube Channel

I post regular fun on YouTube like me playing the bass and anything else I find fun. 

Get Something Built

All project work goes through Katapult Media. Business is open. Let’s chat.

Flex Quick Tip: UrlRequest Basic Auth

I am building a mobile app [will release soon] and Basic auth is required but all the normal approaches were failing on my devices until I started looking through the available UrlRequest properties and wound up finding a gem.

URLRequestDefaults.setLoginCredentialsForHost(host, username, password);

Yes, I’m serious. No more Base64 encoding, appending text, etc to authenticate a UrlRequest. Know this is only for AIR 1.0+ but that means it works for mobile. 🙂

There isn’t anything special required. Just call the method with the appropriate details [host means domain name not protocol (http, https, …), etc]. Peep the docs and enjoy!