  In this paper, we investigate optimal control problems for Allen-Cahn
equations with singular nonlinearities and a dynamic boundary condition
involving singular nonlinearities and the Laplace-Beltrami operator. The
approach covers both the cases of distributed controls and of boundary
controls. The cost functional is of standard tracking type, and box constraints
for the controls are prescribed. Parabolic problems with nonlinear dynamic
boundary conditions involving the Laplace-Beltrami operation have recently
drawn increasing attention due to their importance in applications, while their
optimal control was apparently never studied before. In this paper, we first
extend known well-posedness and regularity results for the state equation and
then show the existence of optimal controls and that the control-to-state
mapping is twice continuously Fr\'echet differentiable between appropriate
function spaces. Based on these results, we establish the first-order necessary
optimality conditions in terms of a variational inequality and the adjoint
state equation, and we prove second-order sufficient optimality conditions.
