back surface color

I have a problem in back surface coloring.

I give two different colors (red front, white back) to the surfaces.

I draw a triangle on the screen. When I rotate that triangle I realized that front and back surfaces have same colors.

My coloring code for front and back surfaces is below:

    glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
    glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse2);
    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular2);
    
    glMaterialfv(GL_BACK, GL_AMBIENT, mat_ambient);
    glMaterialfv(GL_BACK, GL_DIFFUSE, mat_diffuse1);
    glMaterialfv(GL_BACK, GL_SPECULAR, mat_specular1); 

I used two light sources in z and -z directions.

Would you please tell me what the problem can be?

Could you strip down your code to the relevant parts and post the result?

Have you enabled the double sided lighting using the GL_LIGHT_MODEL_TWO_SIDE lighting model parameter (glLightModel)?

Yes, you are right. The problem solved when I changed my light model.

Thanks Komat