You need to sign in to do that
Don't have an account?
Auth. Provider continuously returning to provider
I enabled an Auth. Provider for our community to authenticate through our company OpenId server. I've got the connection working, it gets to our server, and I'm able to use it to authenticate, but when it returns to the community it just bounces back to the auth server, opening infinite new tabs.
Here's the code in the handler that I pulled from the Trailhead example that authenticates to Facebook.
Any ideas why this is continuously requesting authorization?
Here's the code in the handler that I pulled from the Trailhead example that authenticates to Facebook.
global User createUser(Id portalId, Auth.UserData data){ User u; if(!canCreateUser(data)) { u = null; } else { List<User> userList = [select id from User where email =: data.email]; u = userList[0]; } return u; }The other method "canCreateUser" is just validating the data object values to see if they're null.
Any ideas why this is continuously requesting authorization?
![](/forums/img/s.gif)
Just got help from Salesforce about this issue. It turns out that the query is comparing email when it should be comparing to federationidentifier. Federationidentifier is a value I've never heard of or seen in any documentation. But once I changed the query to
Authentication worked..