This post is a continuation of

On modern Linux systems, you can configure only one file (systemd/networkd without wpa_supplicant)

networkd/systemd uses wpa_supplicant, but the configuration is in one place, where you have the wifi credentials and the systemd/networkd configuration in the same place.

[Match]
Name=wlxbcec2304ec


[Network]
DHCP=yes


[WiFi]
SSID=WIFI_NETWORK_NAME
PSK=WIFI_NETWORK_PASSWORD

wlxbcec2304ec is the network interface

The wifi credentials are:

[WiFi]
SSID=WIFI_NETWORK_NAME
PSK=WIFI_NETWORK_PASSWORD

You should not write wifi or WIFI but Wifi

This configuration sends the credentials to wpa_supplicant to log in.