The president sought to take credit for the legislation, despite months of pressure to kill it. The bill has significant exceptions that could mean many documents would stay confidential.