iOS implementation of FlexAuth