The National Insurance Scheme in Norway
From the Membership of the National Insurance Scheme page on Nav.no:
Membership of the National Insurance Scheme is the key to your entitlements from NAV. You do not have to be a Norwegian citizen, registered with the National Population Register or pay taxes in Norway. What is crucial is that your residence in Norway is lawful.
National insurance entitlements depend on present or previous membership. Some entitlements may however, be granted to the family of a member of the National Insurance Scheme.
The benefits that you can claim will be determined on what coverage your membership provides. Some national insurance benefits require that you have been a member of the National Insurance Scheme for a certain time. You can read more about this under each separate benefit