It is a fundamental Islamic principle that there is no compulsion in religion. Hence there is no contradiction in being a citizen of a secular democratic Republic and being a Muslim or Christian or holding on to any other belief.
Hence, instead of providing weapons to Boka Haram, followers of a religion which commands its followers to go all the way to China to seek knowledge and experience, would have provided the group with the resources to build schools to teach young people to have faith but also to become nurses, doctors, engineers, inventors, etc so that they would work to eradicate poverty and promote prosperity and human decency and encourage the people to pursue virtue over pride, arrogance, deceit, cruelty and licentiousness.
In the same vein, Boka Haram would try to win the hearts and minds by virtuous living instead of putting a dagger in the chest of the parents of 270 parents by abducting their children as if we have returned to the days of the transatlantic slave trade.
The main problem however is that African countries have failed to use schools and communities to teach Republican and Democratic values so that citizens would respect their compatriots and respect their beliefs.
Those who put ideology above their humanity would see those who defer from them as monsters and pests to destroy without mercy. To such people religion takes a sectarian divide and their fellow Africans who had suffered so much from discrimination would be treated like toys in their hands which they play with like objects without life and feelings. Virtues of nationhood and a sense of belonging to a people need to be taught in formal and informal schools, non religious and religious institutions alike.