Online AP comp science courses to take the AP exam

Hi, my son’s school does not offer AP comp science, so we are looking into online courses. Edhesive seems like a good one. My question is: does the course need to be accredited by Collegeboard to count?
Can he take this course and take the AP exam? Is that course enough to prepare him?
The other option is through Johns Hopkins, which is quite expensive.