Topic-icon Forcing Registration and only then Social Connection

Active Subscriptions:

None
12 years 4 months ago - 12 years 4 months ago #40439 by joomleb
Hi to all,
I'm running Joomla 3.2.1 + Seblod 3.2.1 + JFBConnect 5.2.2

I'm using SCLogin module for Login and Registration (no others links in the site):
A - I set as "Registration Component": "Joomla" and when I click "Register" in SCLogin bring me on the right Seblod Registration page CCK (instead of the standard Joomla)
B - But I can also click on one of the Social Buttons and follow the "Normal" (not Automatic) Registration I set in JFBConnect

Well, I want completely skip this Registration B way.
I want force my new Users to do a Normal Registration and use the Social Buttons only to connect their Social profiles.
Please, How to do it ?
I thought one quick solution is to have in SCLogin module the way to hide "Show Connect Account Button(s)" in the "Login View Settings" tab as we have in the "Logout View Settings" tab. What do you think about ? How to ?

Why?
Because for me there are three "bugs" I cannot solve in the "B" step:
1st - The "Normal" JFBConnect registration don't bring me anymore to the "Seblod Registration Page CCK". So I'll have two registration forms. Anyway I can try to keep as simple as possible my "Seblod Registration form" and "copy" the "Normal" JFBConnect registration form.
2nd - OK, I have auto populated the fields, but I cannot manage the fields like, at minimum establish the fields order.
3rd - The most important, in my opinion is a BUG:
- I set the JFBConnect "Normal" registration to Hide Username field and auto populate it with email.
- I set also to auto populate the email field, but leave it editable. Often happen that Users have a Social email that they don't want use for the Site registration.
- But, if I change the email into the field and then click "submit", the User is registered with the new email, but as Username is saved the "OLD" email. I think that if I choose to auto populate the Username field ( hided ) and during the Registration in the form I change and confirm another email, is this last email that have to be imported as Username!
Last edit: 12 years 4 months ago by joomleb.
The topic has been locked.
Support Specialist
12 years 4 months ago #40453 by alzander
If you want to prevent JFBConnect registrations from happening, you'd need to make a minor modification to our code. In the /components/com_jfbconnect/controllers/login.php file, around line 63, you'll see:
if (!$jUserId)
{
        $profile = $provider->profile->fetchProfile($providerUserId, array('email'));
Update that to:
if (!$jUserId)
{
        $app = JFactory::getApplication();
        $app->enqueueMessage("You must create an account first before you can login with a social network");
        $app->redirect(JRoute::_('index.php?option=com_seblod&view=register');
        $profile = $provider->profile->fetchProfile($providerUserId, array('email'));
I really don't know the URL for seblod registration, but hopefully that gets you close enough to what you're looking for!

Thanks,
Alex
The topic has been locked.
Support Specialist
12 years 4 months ago #40454 by alzander
I hope that above helps. As to the extra points you edited and added:

I thought one quick solution is to have in SCLogin module the way to hide "Show Connect Account Button(s)" in the "Login View Settings" tab as we have in the "Logout View Settings" tab. What do you think about ?

We could add this, but then the users that have 'connected' their accounts wouldn't be able to login with those social networks... somewhat defeating the point. The change above lets them register with Seblod, but then they can later connect and login with their social accounts.

On a side note, the above change I provided will not let the user login with social networks and have their account automatically connected. I can help you shift the change I provided to a spot that would redirect completely new users to the registration page while auto connecting ones that already have the same email on your site.

For the other points:
1/2) Yeah, we don't have a Seblod profile plugin yet. It's something we're planning later this year. Certainly feel free to get in touch with the Seblod developers and let them know you'd like more integration with JFBConnect. It always helps if we have the other developer on board to make such an integration happen.
3) I can see why you'd say this is a bug. It depends on how you look at it. Right now, the email as username field is just that, it takes the user's social network email and uses it as their email. There's no extra logic behind it. We don't plan to change this behavior, but in your specific case where you're letting the user also update their email, I can see how that's confusing. In 3 years since we added the email as username option, this is the first time we've heard of this discrepancy.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40461 by joomleb
Hi Alex,
if first of all Many Thanks for Support and suggestions. Then:

We could add this, but then the users that have 'connected' their accounts wouldn't be able to login with those social networks... somewhat defeating the point. The change above lets them register with Seblod, but then they can later connect and login with their social accounts.

Well, you are right, I had not thought of that.

On a side note, the above change I provided will not let the user login with social networks and have their account automatically connected. I can help you shift the change I provided to a spot that would redirect completely new users to the registration page while auto connecting ones that already have the same email on your site.

- If I'm not yet registered
- and in first of all I click on Social Button
- The popup ask me to login into my Social, if not yet. So JFBConnect detect if there is yet that email registered.
- If Yes connect and login. If no tell me: "You must create an account first before you can login with a social network"
- and redirect me to the Registration page I input.
Maybe, with a field where to input the registration URL page and a language string for message translation, your suggestion can be a real solution (also for all users who have the same problem)

1/2) Yeah, we don't have a Seblod profile plugin yet. It's something we're planning later this year. Certainly feel free to get in touch with the Seblod developers and let them know you'd like more integration with JFBConnect. It always helps if we have the other developer on board to make such an integration happen.

I'm looking for documentation about your new "CustomDB" plugin. Is it anything that can help us on this issue?

3) I can see why you'd say this is a bug. It depends on how you look at it. Right now, the email as username field is just that, it takes the user's social network email and uses it as their email. There's no extra logic behind it. We don't plan to change this behavior, but in your specific case where you're letting the user also update their email, I can see how that's confusing. In 3 years since we added the email as username option, this is the first time we've heard of this discrepancy.

Well, all "bugs" are a first time. Always there is a first time :D maybe nobody asked you about this because nobody use the "Email" as "Username". This is way I need my Email always the same with the "Username" field.
Anyway, I continue to think is "BUG" in its concept: If in the JFBConnect "Normal" registration I can Hide Username field and set it to be auto populated with email. And I can also set to auto populate the email field, but leave it editable. Well, for me is logical that at the end of the registration my email have to be the same of Username.
Maybe the Username field don't have to be only a pre-population, but also an overwriting from Email to Username when I submit.

PS
Is there a way to establish the fields order in the "Normal" JFBConnect mini Registration form ?
And, what do you think if I take over the "Confirm email" field and use the pre-populated with email "Username" field renaming it (with language override) "Confirm email" ?
The topic has been locked.
Support Specialist
12 years 4 months ago #40475 by alzander

- If I'm not yet registered
- and in first of all I click on Social Button
- The popup ask me to login into my Social, if not yet. So JFBConnect detect if there is yet that email registered.
- If Yes connect and login. If no tell me: "You must create an account first before you can login with a social network"
- and redirect me to the Registration page I input.
Maybe, with a field where to input the registration URL page and a language string for message translation, your suggestion can be a real solution (also for all users who have the same problem)

To have the automatically link users by email setting work, you'd need to move the code change I presented above lower in the same file. Open the /components/com_jfbconnect/controllers/login.php file and go to line 96. You'll see:
// Check if no mapping, and Automatic Registration is set. If so, auto-create the new user.
            if (!$jUserId && !JFBCFactory::config()->getSetting('create_new_users'))
Add the change above those lines, like:
$app = JFactory::getApplication(); 
$app->enqueueMessage("You must create an account first before you can login with a social network"); 
$app->redirect(JRoute::_('index.php?option=com_seblod&view=register'); 
// Check if no mapping, and Automatic Registration is set. If so, auto-create the new user.
if (!$jUserId && !JFBCFactory::config()->getSetting('create_new_users'))
As for making that into an option with custom redirection and other features, that ability is already 'mostly' available. It would simply need a Seblod Social Profile plugin. With a Social Profile plugin, you can set JFBConnect to automatically redirect new users to that extension. We currently have support for integration with JomSocial and EasySocial's registration flow. Once there, the profile fields are pre-filled with the user's social network profile information already.

The only thing missing in your case is a Seblod plugin. Again, that's planned, but I don't have a timeline as it's not highly requested and we haven't reached out to the developer of Seblod yet.

I'm looking for documentation about your new "CustomDB" plugin. Is it anything that can help us on this issue?

We don't have any documentation for it, outside of the tooltips when that's enabled. Basically, you can set a specific table in your database that can be written to when a user logs in. There are the same easy drop-downs to select which fields go into each column of the table for the user. So far, the plugin has been well received by the users that need the functionality. If you can't get it, or have any questions, just let me know.

Maybe the Username field don't have to be only a pre-population, but also an overwriting from Email to Username when I submit.

This is something we may look into. However, our setting doesn't state that it will use the input from the user. There are many JFBConnect sites already using the email as username feature, so changing this behavior could change what is happening on their sites as well. It's something we'd have to be very careful about, and I'm not sure if we'd make this change.

Is there a way to establish the fields order in the "Normal" JFBConnect mini Registration form ?

Not really. Most of those fields are generated automatically by Joomla or any social profile extension plugins you have enabled. If those 3rd party profile extensions let you re-order the plugins, that ordering will affect the mini-registration form.

And, what do you think if I take over the "Confirm email" field and use the pre-populated with email "Username" field renaming it (with language override) "Confirm email" ?

That would be fine. The purpose of enabling/hiding those fields is allowing the admin to setup the registration flow how they want, with as few fields as are required. Your users doesn't know/care if it's their email or username their setting up. I would urge caution if your site displays usernames anywhere as you'd be exposing your user's email addresses to everyone.. something that most users don't appreciate.

Finally, if you're planning to setup Twitter authentication, there is no way for JFBConnect to get the user's Twitter email address.. so make sure whatever system you come up with would work in that scenario as well.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40484 by joomleb

if you're planning to setup Twitter authentication, there is no way for JFBConnect to get the user's Twitter email address.. so make sure whatever system you come up with would work in that scenario as well.

What's happen trying to Register with Twitter if I set on Registration to auto populate Username with the Email and hide + autopopulate Email and Show and disable ?!?

Well, maybe this issue stop all my ideas and reduce my possibilty to only one solution:
"You must create an account first before you can login with a social network"

As for making that into an option with custom redirection and other features, that ability is already 'mostly' available. It would simply need a Seblod Social Profile plugin. With a Social Profile plugin, you can set JFBConnect to automatically redirect new users to that extension. We currently have support for integration with JomSocial and EasySocial's registration flow. Once there, the profile fields are pre-filled with the user's social network profile information already.

(Remember I'm not a programmer) If your code suggestion:
A - show me only a message like "You have to be Registered before you can login with a social network" in the popup. I have simply to close the popup manually and click on "Register" button in SCLogin that bring me to the right Seblod Registration page;
B - or show me the message "You have to be Registered before you can login with a social network" in the popup, and a "Register" button is shown bottom (same "Register" button we have in SCLogin). Clicking on the button the popup is closed and again bring me to the right Seblod Registration page.
So, the Seblod plugin is not a must right now, because, if I set Joomla in SCLogin as "Registration Component", the Register button bring me rightly to the Seblod Registration page. The auto population is not an urgent right now, I can wait the Seblod plugin release.

- Why not add an option in SCLogin to have the JFBConnect work as your hack ? I think would be a very good feature add for all your Users!
- Is it possible create and/or use a Language string for the message "You have to be Registered before you can login with a social network" ?

Have a documentation/tutorial about the new "CustomDB" plugin would be a good thing for those are not programmers like me.
I want understand How can I use this plugin with Seblod features.

There are many JFBConnect sites already using the email as username feature, so changing this behavior could change what is happening on their sites as well. It's something we'd have to be very careful about, and I'm not sure if we'd make this change.

I think my suggestion is a solution, not the problem.
If you use Username like Email the Username have to be always as the Email field! This is the only must, nothing else (as I described on my tip).

Not really. Most of those fields are generated automatically by Joomla or any social profile extension plugins you have enabled. If those 3rd party profile extensions let you re-order the plugins, that ordering will affect the mini-registration form.

I don't understand very well. So, Why when I click to "Register" in SCLogin I'm redirected to the Seblod Registartion page, while if I register with Social Button, always in SCLogin, a "Mini Registration" JFBConnect is shown ?!?

I would urge caution if your site displays usernames anywhere as you'd be exposing your user's email addresses to everyone.. something that most users don't appreciate

I'm agree, but I always use to show "Name"... for me Username "doesn't exist"... :D
The topic has been locked.
Support Specialist
12 years 4 months ago #40491 by alzander

What's happen trying to Register with Twitter if I set on Registration to auto populate Username with the Email and hide + autopopulate Email and Show and disable ?!?

If JFBConnect can't automatically populate the username field (or email field), we will show that to the user.. even if you have it set to hide. So the "hide" setting isn't guaranteed, it's just what JFBConnect will try if possible.

Registration redirect suggestions
We can't show the 'Register' button in the popup like you're asking. The user would have to *try* to login with their social network credentials before we try to log them in. So, the page will have to redirect to 'our' login flow. In that flow, we can detect if the user that just logged in with a social network actually has an account.. and if not, redirect them to a specific registration path. That's the code we provided above.

There's no way to detect if the user has an account on your site *before* they click the Facebook login button though.

- Why not add an option in SCLogin to have the JFBConnect work as your hack ? I think would be a very good feature add for all your Users!

Again, this ability is already possible for extensions that we have Social Profile plugins for. If a user doesn't have an account, they will automatically be redirected to the proper registration flow. Instead of an option like you're asking, the best solution would be to develop a Seblod profile plugin.

- Is it possible create and/or use a Language string for the message "You have to be Registered before you can login with a social network" ?

See the above. As noted, the option for requiring registration first likely isn't something we'd implement because we already support that ability if you're using the right combination of extensions. Adding a language string for redirection may be something we add though. We'll have to look into this idea more.

I don't understand very well. So, Why when I click to "Register" in SCLogin I'm redirected to the Seblod Registartion page, while if I register with Social Button, always in SCLogin, a "Mini Registration" JFBConnect is shown ?!?

The register button in the SCLogin module is redirecting to the Joomla registration page. I'm assuming that Seblod has a registration redirection page that redirects any requests to the Joomla registration page to Seblods registration page.
The social login is going to the JFBConnect registration page because you have the "Registration Component" setting in JFBConnect set to "JFBConnect". That may be your only option since we currently don't support sending users down the Seblod registration path. That's something we'd have to implement.

I hope that helps answer your questions,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40496 by joomleb

If JFBConnect can't automatically populate the username field (or email field), we will show that to the user.. even if you have it set to hide. So the "hide" setting isn't guaranteed, it's just what JFBConnect will try if possible.

Please, Is this anything that happen only with Twitter or Can happen also with Facebook and Google+ ?

There's no way to detect if the user has an account on your site *before* they click the Facebook login button though.

OK

Registration redirect suggestions
We can't show the 'Register' button in the popup like you're asking. The user would have to *try* to login with their social network credentials before we try to log them in. So, the page will have to redirect to 'our' login flow. In that flow, we can detect if the user that just logged in with a social network actually has an account.. and if not, redirect them to a specific registration path. That's the code we provided above.

Why not have a standard feature ?
How - create a selection in SCLogin if I want force the Registration before Connecting Social. If "Yes" SCLogin follow your code suggestion. Then instead to put directly the Registration path URL page in the code, write to follow the "Registration Component" field selection (like happen if I click on Register Button). Simple, no?!?
Can be usefull if Users want force the Registration before Social Connection, and in all cases when a plugin is not yet developed...

The social login is going to the JFBConnect registration page because you have the "Registration Component" setting in JFBConnect set to "JFBConnect". That may be your only option since we currently don't support sending users down the Seblod registration path. That's something we'd have to implement.

Again, this ability is already possible for extensions that we have Social Profile plugins for. If a user doesn't have an account, they will automatically be redirected to the proper registration flow. Instead of an option like you're asking, the best solution would be to develop a Seblod profile plugin.

See Above

See the above. As noted, the option for requiring registration first likely isn't something we'd implement because we already support that ability if you're using the right combination of extensions. Adding a language string for redirection may be something we add though. We'll have to look into this idea more.

Anyway, also with auto population running (plugins), a "You have to be Registered before you can login with a social network" I think is a good message to put on top of the Registration page where you are redirected. Infact if a User click on Social Button and the Social is not able to give us all informations and the User is not yet Registered, in reality what we are asking to the User is a Registration (maybe he thought to make a "connection" clicking on Social Buttons...)

The register button in the SCLogin module is redirecting to the Joomla registration page. I'm assuming that Seblod has a registration redirection page that redirects any requests to the Joomla registration page to Seblods registration page.

That's right. Anyway Seblod doesn't hack joomla, so by default the Joomla Registration fields are the same of Seblod Registration fields. Infact I can find all Seblod Registered users together with all Joomla Registered users, all, in the standard joomla User Manager. What's change is that in Seblod I can "manage" fields like Hide, autopopulate, establish rules, fields order, and so on... (like in my case modify the "Username" fields...)
The topic has been locked.
Support Specialist
12 years 4 months ago #40498 by alzander

Please, Is this anything that happen only with Twitter or Can happen also with Facebook and Google+ ?

There are very specific circumstances where Facebook and Google/Google+ may not return an email address for a user. It depends on how a user has validated their email address in each of those social networks (for security reasons). It's very *rare* for an email address to not be returned from Facebook or Google, but it does happen. An email is never returned from Twitter.

How - create a selection in SCLogin if I want force the Registration before Connecting Social. If "Yes" SCLogin follow your code suggestion. Then instead to put directly the Registration path URL page in the code, write to follow the "Registration Component" field selection (like happen if I click on Register Button). Simple, no?!?
Can be usefull if Users want force the Registration before Social Connection, and in all cases when a plugin is not yet developed...

We already have a method for this, using the plugins. I understand we don't support it with Seblod yet. However, we plan to. We really try to avoid adding additional settings to our extensions. There are plenty of options in them already and if every option that a user wanted were added, our configuration pages would be 20x longer than they already are. We are always trying to strike a balance between ease of use and power, and it's one of the things we think we do well.

Again, we'll be looking into a Seblod plugin. Of course if you really want one sooner, I'd recommend contacting the Seblod developers. Having their interest in a plugin being developed definitely makes things go quick.

Anyway, also with auto population running (plugins), a "You have to be Registered before you can login with a social network" I think is a good message to put on top of the Registration page where you are redirected. In fact if a User click on Social Button and the Social is not able to give us all informations and the User is not yet Registered, in reality what we are asking to the User is a Registration (maybe he thought to make a "connection" clicking on Social Buttons...)

On the registration page, there are already language strings available to manipulate. The whole "Welcome Bob! Thanks for logging in with Facebook.." string is an option you can set. Please feel free to edit our language files to suit whatever you need. I don't think additional strings are necessary there, but if you feel so, let me know what you feel you can't do with the options already present.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40620 by joomleb
Hi Alex,

Seblod plugin:
there are no canches right now to have help from Seblod community, all are too busy on changing a lot of things on their portal.
You are my last hope. Please, :D
What I can add is that the standard Seblod Registration form is like the standard Joomla Registration form, same fields / same DB fields !
So, nothing complex with other fields to be imported right now...

Language strings:
I'm looking into language files... I'll update you

Your temporary hack suggestion:
I'm testing... I'll update you in few ours
The topic has been locked.