I have a custom Auth Provider (Apex class extending Auth.AuthProviderPluginClass
).
I also have a generated Auth.RegistrationHandler
.
In the sample code there is a line like so:
if(data.attributeMap.containsKey('sfdc_networkid')) {
Unfortunately, nowhere in my Auth Provider class am I passed the networkid when user logs in via SSO in their 'Digital Experience' site, and it is not injected into my data.attributeMap
passed to my reg handler.
If i am not using one of built in Auth Providers, how am i supposed to know which digital experience the user is logging in to?
Network.getNetworkId()
method you should be able to invoke for this. See the documentation for more detail. Are you suggesting it doesn't work, because the user isn't yet authenticated?