0

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?

2
  • 1
    There is a static 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?
    – Phil W
    Commented Jun 21, 2021 at 6:32
  • @PhilW didn't occur to me to try it :) if you add this as an answer i will accept it.
    – zaitsman
    Commented Jun 21, 2021 at 6:41

1 Answer 1

1

There is a static Network.getNetworkId() method you should be able to invoke for this. See the documentation for more detail

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .