Hi,

sorry to use a bug tracking system to file my query, but I don't really seem to be able to find the information I need.

Several places point to this module to create Drupal logins using Twitter and Facebook accounts, but the best I could do is to create a Twitter connector where a user can connect an existing Drupal account to Twitter one but I don't seem able to see at user login page level any "login with Twitter" and similar.

Can some kind soul point me out to some how to get this logins appear in Drupal login page?

Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Frans’s picture

See the permissions page and the connector block.

Anonymous users must have the rights to connect via a connection.
There is a connector block that shows all buttons that a user can connect by.

barraponto’s picture

Title: How to... » How to map the resource fields to user profile fields (like email)
Version: 7.x-1.0-beta1 » 7.x-1.x-dev

I just documented how to install and configure oauthconnector, but I can't get the field mapping to work yet. The article is availabe at http://en.barraponto.blog.br/blog/how-to-enable-facebook-login-using-oau..., feel free to link to it from the module page :)

StoraH’s picture

I still can't get the field mapping to work with any field. It works to login from linkedin, twitter and facebook but user name is still like oauthconnector_twitter__10080034. I found very lite documentation and no complete guide. Am I doing something wrong or is it broken? If it's broken I will try to help out and solve it.

Topcheese’s picture

I'm not messing with it now, but I too had problems with trying to map the fields after trying to figure it out. This module is being included in Drupal Commons, so perhaps a tad bit more documentation could be made available in order for us to be able to properly test this? The only things I've found from searching describe how to do what already works, and that is the connection part, but the mapping part seems tricky.
Thanks.

Frans’s picture

Mapping is tricky :)

Problem here is that it is very flexible. I am not able to write full documentation, but here are the general ideas behind it. It might help you out, so that you or someone else can write documentation.

1. External sources can be anything (twitter, G+, facebook ...)
2. Every external source has its own format and layout (json, xml)
3. We try to abstract on field basis. Main reason is that there can be multiple resources. (ID can be in another resource then FullName)
4. A resource must be available via oauth.
5. To map a field, we need the resource, the format and the fieldname in the resource; Ofcourse we also need the place to save it in the Drupal account (field on profile).
6. We need at least a external ID to identify a user on the external source.
7. A field in oauthconnector lives between a Drupal Account and the external source. The function is abstraction and filling a drupal account.
8. you can add more fields; provides a way to add more abstractions.

You need to know what your resource is and the format. When you install Devel, you will get an extra tab to explore external resources and their format.

I know it is hard to get your head around; the interface is difficult and documentation sucks.... So although it is very flexible, it is hardly useable for the average user... but setting up and administering connections via oauth is not for the average user.

Ideas for a better interface (or even better... patches) are more then welcome.
Documentation is even more welcome!

StoraH’s picture

Thanks for the fast reply! Unfortunately I done all that.. With devel I can see all the external resources and do proper mapping against a field I created.
On the user account when I click "Sync local profile with Twitter" I can see the custom fields getting prefilld with the right information, when I hit "Save sync with Twitter" I get a white screen and no data is saved. I attach some screen shots, don't know if they help..
@Frank Have you got this to work?

Frans’s picture

The name is FranS :)

Oauth works... that is the good news! Getting a prefilled form means the configuration on the oauthconnector part is good.

Yes, I have it working (basicly I programmed this nonsens :))

On the user account when I click "Sync local profile with Twitter" I can see the custom fields getting prefilld with the right information, when I hit "Save sync with Twitter" I get a white screen and no data is saved. I attach some screen shots, don't know if they help..

A white screen (WSOD) means something goes wrong on save. That could easily be, because the form where you are comming from is basicly the user profile edit form, with all fields on #access = FALSE, except the fields that can be synced. Probably another module (or due to a different configuration) does something on user_save, and needs more info... causing a WSOD.
The code for sync'ing is not the best I ever wrote... and the idea "all #access on false" might also be a bad idea...

Anyhow, can you post the 500 error? PHP produces an error, causing the WSOD. You can find that either in your recent logs (drupal) or in the webserver error_log. (or you need to tweak the PHP error log settings).

StoraH’s picture

Sorry, FranS ;)
I don't get any error log message when trying to save the sync but I do get one when I load the "Synchronize profile with Twitter" page; "Bad request of https://api.twitter.com/1/account/verify_credentials.json: Bad Request"
This is weird to me couse on the same page it actually fetching the correct data.

Frans’s picture

in connector.pages.inc on r220 the external resource is called.
http://drupalcode.org/project/connector.git/blob/refs/heads/7.x-1.x:/con...

if (is_callable($connector['information callback'])) {
    $info = $connector['information callback']($connector, $xuid);
}

can you comment it out like this:

if (is_callable($connector['information callback'])) {
    //$info = $connector['information callback']($connector, $xuid);
}

And see if you can save then?

StoraH’s picture

I havent tested to comment out the code yet but I did a fresh Drupal installation and installed the necessary oauth modules and now it works.. At least the mapping of the custom fields, the user name is still like "oauthconnector_twitter__10080035". In the project I working on right now(where the oauth dosent work) I do some altering on fields on the user profile. I will look in to this tomorrow and get back to you.

Topcheese’s picture

I only played with it for a minute, but I will spend some time on it tomorrow. I think the fields mapped fine on with Twitter, but I did get that default mapping when an anonymous user connected.

Drupal is a flexible framework, and I think you're on the right track with being flexible and all with this project. I'm obviously not the only one that thinks this is good, so perhaps with a little more tlc we can move this forward.

I was trying to add the meetup.com API to the provider list, and couldn't log in for some reason. I'm familiar with oauth, and some other similar modules that I've been playing with, so I'll see what I come up with again.

StoraH’s picture

I think im actually going over to the fboauth module. I would prefer this module couse it a lot more flexible and will probably use it when it's get more stable. But the main reason I go over to only support facebook(maybe google+) was that I found out that neither twitter or linkedin support email through oauth, which I need.

Topcheese’s picture

It's probably best for what you need it sounds like. I"m using Drupal Commons which is using this module and I also had an interest in some Meetup.Com API modules, so I thought I'd try this route first.

I got it to authorize on meetup, but it's not showing up on the profile page and it just takes me my site staying with,

Authorization finished
The application has been authorized

I'll play with field mapping and endcalls later on and see if I can figure it out and make it do something.

Frans’s picture

@Topcheese,
Most common error is that the external UID cannot be found.

Topcheese’s picture

Good call Frans ... that was the one URL I seemed to have a little trouble finding, but it's good now. Still needing to add this patch Profile syncing: Fatal error: Call to undefined function user_profile_form_validate()

I should also add that I'm using what I believe is the newest version named connector_for_fb__google___twitter_and_linkedin.

mcfilms’s picture

@Topcheese, were you ever able to successfully connect using the MeetUp api? It's pretty well documented (see http://www.meetup.com/meetup_api/auth/) and I thought it would be able to muddle my way through it. But I am having an issue just attempting to fetch the data:

Exception: Failed to fetch data from url "https://api.meetup.com/oauth/request//oauth/request_token" (HTTP response code 401 Unauthorized): {"errors":[{"code":"auth_fail","message":"Invalid oauth credentials"}]} in DrupalOAuthClient->get() (line 347 of /var/www/vhosts/site.com/httpdocs/sites/all/modules/oauth/includes/DrupalOAuthClient.inc).

I think allowing a user to connect with their meetup.com credentials would be useful for a community-oriented platform like Drupal. I am working with someone that might be able to sponsor some development on this front and deliver a Oauth2 supported preset for MeetUp.com

I guess I should post this in "Paid Services" as well, but I feel i have the best shot of catching the eye of a developer experienced with Oauth right here.

Topcheese’s picture

@mcfilms, yes I did get it to successfully authorize and connect with the Meetup.Com site. That was when I was testing it with Drupal Commons 7, but I had set it aside because I was unsure if they were going to use it in Commons.

They are using this project in Commerce Kickstart, so I've recently set it up Meetup to connect with Kickstart, but that was it. Once you figure out the fields that you want to map, then I think it is suppose to be fairly trivial to configure through the interface, but I'm really more interested in integrating with Commons at some point.

I was using this project Meetup Events, but I still haven't figured out the route that I want to take. I think that it is not only useful, but it is crucial for a community site to have such a preset available.

Why? What is a real "community" anyways? Online vs. Physical, although times are a changing mighty fast, I still believe we are not droids and that tangible still means something. So, that means unless we want to totally distance ourselves from humanity like a bot, we need to have a Meetup.Com preset.

I will be happy to share any work that I do on it, and I look forward to any work that you do towards a Meetup solution.

mcfilms’s picture

Thank you. The main feature request I received was to support single sign on; allowing the visitors to create an account and sign up using their MeetUp.com credentials. THAT is the part that is failing for me.

Connecting the itinerary or the location using something like Meetup Events is also useful. But my primary goal is to facilitate users signing in. Were you able to get that part working with Kickstart?

Thanks!

Frans’s picture

mcFilms

First thing I noticed is that you have 2 slashes in your uri
https://api.meetup.com/oauth/request//oauth/request_token

And "Invalid oauth credentials" probably means that your key/secret stuff is not correct.

mcfilms’s picture

Thank you Frans, I corrected that and as you see I started a more descriptive thread at: http://drupal.org/node/1901450

Topcheese’s picture

mcFilms, for some reason I could only get it to authorize, but that's it. I have to see how they implemented the other presets, but I think I'm just not matching up the right field in the UI with the right token from meetup.

I need to get to this sometime this week. It really shouldn't be that hard, but I haven't really looked into yet because I haven't decided if I was going to roll my own solution, or try to adapt one of the other solutions as to not duplicate work. I don't mind starting from scratch either, but this project that is not a problem.

mcfilms’s picture

Topcheese, I have not yet found where meetup documents what the username, real name, email and avatar are called on their site. Also, as I (think I) am learning on that other thread, http://drupal.org/node/1901450, it seems the order OAuth Connector passes the tokens is not the same as what MeetUp wants.

But if I can solve this I'll be sure to document it here.

mcfilms’s picture

Issue summary: View changes

Typos

secretsayan’s picture

Issue summary: View changes

I was able to authorize via LinkedIn and retrieved most of the data from the user profile.

But the real show stoppers are the user picture and date of birth.

anyone had any luck with those???????????

secretsayan’s picture

Bingo Date of Birth i s done