Viewing 6 replies - 1 through 6 (of 6 total)
  • I found your question while looking at the same thing. The documentation at their site is quite good but doesnt offer much help re the wordpress plugin. So, I didnt want to go over the plugin code and find the spot where they return the token. I just hooked a function to wordpress INIT event and check for the referer. If you watch your connections, the api calls the callback url with a referer field, and it includes the connection_token in it. Something like:

    $referer = $_SERVER[“HTTP_REFERER”];
    add_user_meta( $id, ‘referer’, $referer, false );
    if( stripos( $referer,’askittv.api.oneall.com/socialize/redirect.html’ ) !== false ){
    if( ( $query_start = stripos( $referer, ‘?provider_connection_token=’ )) !== false ){
    $token = substr($referer, $query_start + strlen(‘?provider_connection_token=’));
    add_user_meta( $id, ‘connection_token’, $token, false );
    }
    }

    As you see, im storing the token with the metadata of my user.
    Should work until something better comes up.

    A much better solution below:

    If you dont mind editing the plugin, go to communication.php file and around line 845 paste:

    update_user_meta ($user_id, 'oa_social_login_latest_connection_token', $connection_token);

    Basically, that function checks for a logged in/new user registration and stores data associated with it (if its from FB: profile picture, name, email, etc). For some reason it doesnt store the connection_token.. so I added code for it.

    Hope that helps someone

    Cheers!

    Thread Starter Serafín Danessa

    (@sdanessa)

    Thanks Juan, Gonna try it both ways, but probably the firstone is better for future plugin updates.

    Gracias y Saludos!

    Hi Juan, I do not see a communication.php in WSL where is it located?Thanks

    Hi Mel,

    communication.php is located in includes/ folder. Full path: /wp-content/plugins/oa-social-login/communication.php

    What are you trying to do? I thought I needed the connection token to retrieve data from facebook, but apparently the plugin stores it somewhere (a cookie maybe) so I didnt hack it in the end.

    @sefod: no se ven muchos compatriotas por aca ajaja! un abrazo!

    Oh your using a different plugin, oa social this is the forum for wordpress social login that’s why it was different

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Get user token to call API’ is closed to new replies.