Except as otherwise provided, where the oath of allegiance is or shall be required by law, without any official or other oath, the same may be administered by any justice, judge or magistrate of any court of this State, who shall administer the oath of allegiance to any person who shall apply to take the same.
N.J.S. § 41:2-6