の/ん in a question sentence is for asking for a clarification. See: Question Markers: か and の
The connotation that the の has is to seek clarification based on background contexts, while the か doesn’t require any context.
The plain question marker か allows you to just ask yes or no while the connotative question marker の allows you to clarify something that you doubt about. You may sometimes be rude if you suddenly try to clarify something without contexts.
When you have a previous context and are asking "is it (really) okay?" referring to it, いいんですか is the natural choice. For example, when someone said to you "Hey, you can take that umbrella!", then your response should be いいんですか. But you have to say この傘を持って行っていいですか without の/ん if this is the first time you mention 傘 in a conversation.