Token authentication implementation.