In this paper, an enhanced security mechanism is presented against eavesdropping on spectral amplitude coding (SAC) optical code-division multiple-access (OCDMA) access networks. The reconfigurable coder/decoder (codec) which was constructed with Arrayed-Waveguide-Grating (AWG), optical switch and additional controller unit is used as the basic system to realize the implementation of dynamic code matrix assignment. Instead of employing a huge code space, we adopt the spectral amplitude coding (SAC) with unipolar M-sequence code matrix for a specific signature address (coding) and its match address codeword (decoding). Furthermore, a weighted load balance problem based on the power distribution on each wavelength is investigated, and then a dynamic reconfiguration policy is proposed to choose the best code matrix assignment with the minimum weighted degree of load balance. The evaluation results show that the dynamic reconfiguration policy can outperform a class of static policies in terms of two performance metrics, weighted degree of load balancing and the number of register shifting.