Finally got authorizations working correctly