Skip to main content

#Auth Provider0 personne en discute

Recommendation, when facing User Provisioning Error from Microsoft Entra ID to Salesforce:

I recently faced an issue with the user provisioning integration from Microsoft Entra ID to Salesforce. The error response is seen at the bottom (all included for enabling searching of this by others). 

 

Issue Origin:

The issue was caused by a duplicate user being created:

  1. Proper 'User Real' already existed, without FederationIdentifier
  2. Then the user provisioning system synchronized the users to Salesforce
  3. Since it didn't find a user with the FederationIdentifier, it created a new one 'User Dupe'
  4. We found this, deactivated 'User Dupe' and cleared FederationIdentifier, and set the correct one on 'User Real'
  5. However, the next user provisioning sync failed.
  6. The error message was unclear, but we found the user facing the issue based on a Salesforce User ID in the Entra ID provisioning error logs.
  7. We then tried to set some dummy FederationIdentifier on 'User Dupe' and tried a sync, and then we got a different error.

Probable Root Cause: 

While one might assume that Microsoft Entra ID always retrieves users from Salesforce, before an update occurs towards Salesforce, it instead seems like Entra ID is caching a table of users based on Salesforce user ids, and updates based on this invalid cache mapping (FederationIdentifier -> SF User Id). 

 

The bug overall seems to be in Microsoft Entra ID, so the issue should be raised with their support.

  

Sample Error Message Thrown in Entra ID:

EntrySynchronizationError

  • Result: Failure
  • Description: Failed to match an entry in the source and target systems User 'XX@YY.ZZ'
  • ErrorCode: UnSpecified
  • Error details: Invalid context
  • ErrorMessage: 

An error has occurred when attempting to match an entry in the source and target systems. 

 

Review the common matching failures and error details for more information. Common matching failures: 

  • The target application does not support filtering on the matching attribute. Review your attribute mappings and ensure that the target application supports filtering on that matching attribute.
  • The source entry does not have a value for at least one matching attribute. Review your attribute mappings to identify the matching attribute(s) and ensure that the entry has a value for those attribute(s).
  • The target application denied the request due to an authentication or authorization failure. Ensure that the credentials you have provided have the necessary permissions for provisioning.
  • There is an issue with the target application. It is unreachable, returned a non-specific error, or returned a non-SCIM compliant response. Contact the application developer. 

 

 

#User Provisioning #Auth Provider #Error

0/9000

I have a Auth. Provider in my Org. I have authorize the system admin for the URL, So system admin have access to use the auth. provider, but other user with different profile are not able to access the auth. provider.

 

However I can go to user and I can authorize that user using auth. url for that url, But I don't want to this.

 

is there any another way to authorize all the user with the help of permission set or profile?

 

#Salesforce Developer #Apex #Integration #Auth Provider

1 réponse
0/9000

@Itzik Koren @Matt Bahrenburg @Chuck Mortimore 

We ran into a documented issue where Auth. Providers don't refresh their access tokens unless a previous callout returned http 401. There's a large pool of potential integration partners within Czech banks that, unfortunately, return 403 as a response to an expired access token.

 

To my horror, they're following an API blue print (they've all agreed upon) that mandates to return 403 as a specific response in this case.

 

I put together an idea to make it configurable when an Auth. Provider refreshes the token: https://success.salesforce.com/ideaView?id=0873A000000CXzjQAG and would like to run it past you to gather some more feedback before mobilizing the community. (The idea's about the custom Apex-based Auth. Provider but I trust the same limitation applies to the standard ones too.)

 

Currently, the solution we have is more a workaround using old-school VF page-based OAuth dance + custom settings instead of a proper Auth. Provider + Named Credential. It has a few drawbacks, too, I don't really like for the purpose.

 

Would be really happy to know your opinion on a case like this and if there's perhaps something like that on the roadmap.

 

Thank you!

 

#OAuth #AuthProvider #AuthProviderPluginClass 

7 commentaires
  1. 29 avr. 2024, 18:48

    Perfect, that is what we have been waiting for!! 

     

    Thanks Petr,

     

    Steve

0/9000
Umar Farooq a posé une question dans #Digital Experience Platforms

We need to add Apple log in ID on Community Login Page. To do this required Auth. Publisher setup. With other Apple IDs it also asks to Provide Service ID of Apple Development Account. We checked and found that following Identifier has to provide. 

 

Apple asked to provide Identifier "We recommend using a revers-domain name style string (i.e. com.domain.appname). It cannot contain an asterik(*)."

 

If it is custom application then very simple. For Community based site what value can we provide here. Will it work?

 

#Experience Cloud

 

@* Experience Cloud * @* Salesforce Mobile *

1 réponse
  1. 5 oct. 2021, 19:49

    Hello,

     

    Have you refered to the Salesforce Article on this;

     

    Thanks, Tom

0/9000

Setting up Azure B2C with Salesforce, I am getting stuck on the SalesForce configuration side. in the azure world I have setup the salesforce app in app registation with a user flow. The bit I'm hanging up on is the Auth provider and single sign-on settings. using saml or oauth. I have a 3rd party telly me should be using saml? But I understand B2c azure AD is not like a normal enterprise app setup due to external users will be signing up to the b2c app. pls help :) lollolol

0/9000

Auth. Provider allows the specification of User Info Endpoint URL. If this URL is specified, would Salesforce get user info automatically from the endpoint and pass it to the registration handler as parameters? 

 

Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_auth_plugin.htm

  • Interface: Auth.RegistrationHandler
  • Method: global User createUser(Id portalId, Auth.UserData data)
  • Data structure: 

           Auth.UserData(String identifier,

                                    String firstName,

                                   String lastName,

                                   String fullName,

                                   String email,

                                   String link,

                                   String userName,

                                   String locale,

                                   String provider,

                                   String siteLoginUrl,

                                   Map<String, String> attributeMap)

 

Thanks for answering! 

3 commentaires
0/9000

Hi All,

We are struggling with AccessToken from external provider. We have our own SSO/Auth provider. We configured it via Open ID concept. SSO is working fine. But now we want a functionality like auto user creation based on some parameters from the third party provider. We have to make some API calls to retrieve some values. Also once user login/ A super user can make changes for other users. To have super user make these changes we again need to call third party API for which we need the AccessToken, we were trying to access it via Auth.AuthToken.getAccessToken but it is returning NULL .

 

Initially we were using Open ID but Support recommended to have custom auth provider setup, but we are still receiving the NULL value.

 

If someone else found this issues, and resolved it. Kindly help.

5 commentaires
  1. 17 juin 2019, 00:40
    It found out that Salesforce has 2000 char limit for Access Token and our third party is sending more char than 2000. Thats why SF standard method was failing to retrieve the access token.
0/9000

Hello All,

Any update or news on the support for Sign in with Apple? I haven't had a chance to build a POC around it but it would be good to understand how and when the platform will be able to support this feature. https://developer.apple.com/sign-in-with-apple/

  • Apple is aggressively trying to require this before the end 2019. Is it reasonable to expect support for it on the platform by end of year?

  • Thoughts or considerations supporting auto-generated random “relay” email addresses that Apple will provide as an option when signing up for services.

4 commentaires
  1. 12 juin 2019, 21:19
    Sorry for my confusion. I initially thought you were referring to general login on a mobile app versus a website and not directly native login. We try to use OIDC for both web and mobile apps, so our priority would be web based login.
0/9000

~~~Help me push the idea improving when Auth. Providers refresh tokens~~~

https://success.salesforce.com/ideaView?id=0873A000000CXzjQAG

 

Please help me support this idea to make Auth. Providers more useful when we establish #OAuth connections to other systems.

 

Auth. Providers will refresh the access token only if a previous callout (over a Named Credentials using that Auth. Provider) to another system returned HTTP 401. Many systems, however, return 403 instead and thus the connection breaks off as soon as the access token expires within the Auth. Provider. The behavior is in both standard Auth. Providers as well as in those based on Auth.AuthProviderPluginClass.

 

Thank you for upvotes, comments, retweets or whatever support you may share!

 

#AuthProvider #NamedCredential #Callout

 

@* Customer Architect Community * @Salesforce Identity @Architect Trailblazers 

success.salesforce.com

3 commentaires
  1. 28 févr. 2019, 08:59
    Thank you very much @Chuck Mortimore

    !

    @Guha Arumugam as a workaround, we do the OAuth token management completely custom and avoid Auth. Provider / Named Credential for now, i.e., VF page for the authorization dance and we store tokens in a custom settings.
0/9000

Cross-posting from @Unlocked Packages 

 

I have a package that has some Auth Providers in it (source at the end of the post). When first developed I created the Auth Provider in a scratch org then pulled the source with force:source:pull and all was running smoothly. Now it seems I'm not able to push this package anymore to any other scratch org.

 

After executing the first force:source:push to a new scratch org I get an error with the message "You must enter a value" for the Auth Providers. This is only in the first push thou, the following push commands just don't seem to detect any result since returns a "No results found" message.

 

So I have 2 problems here:

 

* Something seems to be missing from the Auth Provider even though I initially created it in a scratch org and pulled its source.

* After first failed push, following ones don't even try to push the Auth. Providers (and related Named Credentials) again, like if they didn't exist.

 

Have anyone faced a similar issue?

 

https://github.com/jonathanwiesel/RepoExplorer

 

---

 

Update: I've reviewed the AuthProvider documentation from the Metadata API

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_authproviders.htm

 

And it seems that for OpenIdConnect provider types some information is mandatory that the force:source:pull didn't retrieve from the scratch org (defaultScopes and userInfoUrl). I tried specifying directly in the source XML then push it to the scratch org but it seems something is still missing (although with this the second issue disappears, it does try to push it every time instead of only the first).

15 commentaires
0/9000