The accepted answer mostly worked for us, with a minor change.
We use
conn %default
# Settings for all conn to inherit
# But we included this in our settings:
auto=add
As a result the above accepted answer "conn eap-shared" inherited "auto=add" which breaks this. The default "auto=" for ipsec.conf is "auto=ignore" so unless you have set this, the default is used.
One fix would be to remove "auto=add" from "conn %default" and then it becomes the default, another is to change it to "auto=ignore", but yet another is to change the "conn eap-shared" to explicitly include "auto=ignore" and nothing else, inheriting all of the "conn %default" settings. Then in "conn eap-init" add "auto=add" and for each connection after, with "also=eap-shared" also add a line "auto=add"
It is pretty unlikely for anyone to need this and have set "auto=add" in a "conn %default" but if you do, I hope this helps you.
Thanks @ecdsa ( https://serverfault.com/users/95913/ecdsa ) for your answer; It worked for me without having to run RADIUS or other services and now windows users can save their VPN password.
Copy-pasting your solution with the changes we had:
conn %default
# All options shared on all connections, including
auto=add
conn eap-shared
# Because 'conn %default' has all settings shared between all conn, just:
auto=ignore
#And the rest is as-is, since the original already has 'auto=add' in each conn:
conn eap-init
also=eap-shared
# this config is used to do the EAP-Identity exchange and the
# authentication of client and server
eap_identity=%identity
# the following is used to force a connection switch after
# the authentication completed
rightgroups=<any string that is not used as group/class>
auto=add
conn eap-bob
also=eap-shared
eap_identity=bob@strongswan.org
# any options that only apply to this user follow here e.g.
leftsubnet=192.168.20.0/24
auto=add
conn eap-alice
also=eap-shared
eap_identity=alice@strongswan.org
# any options that only apply to this user follow here e.g.
# (note that ipsec.conf does not support ranges, and most kernel
# interfaces do neither, so a range might be converted to a larger
# subnet when installing IPsec policies, so deaggregating the range
# is the most accurate way to do this currently)
leftsubnet=192.168.20.100/30,192.168.20.104/29,192.168.20.112/28,192.168.20.128/28,192.168.20.144/30,192.168.20.148/31,192.168.20.150/32
auto=add
conn eap-john
also=eap-shared
eap_identity=john@strongswan.org
# any options that only apply to this user follow here e.g.
# (see above)
leftsubnet=192.168.30.10/31,192.168.30.12/30,192.168.30.16/28,192.168.30.32/28,192.168.30.48/31,192.168.30.50/32,192.168.10.150/31,192.168.10.152/29,192.168.10.160/27,192.168.10.192/29,192.168.10.200/32,192.168.20.44/32
auto=add
Thanks again @ecdsa ( https://serverfault.com/users/95913/ecdsa )