Added immediate argument to authenticate