How get "OAuth Token" Twitch and Mixer?

Hi Support,

we are implementing a new site for games www.mvp-arena.com in PHP language and we have decided to use your fantastic plugin.
However, we need to further integrate the functionality of the Twitch and Mixer socials platforms.
For this reason, we need to retrieve the authentication "OAuth Token" after user login so that we can use it in the API calls of the Twitch and Mixer social platforms.
Is there any way to get this information using your wordpress plugin?

Thanks in advance

MVP-Arena Team

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team

    Hello,

    yes after the login with a social network the full data is retrieved here:
    https://github.com/oneall/social-login-wordpress/blob/wordpress/3.0-5.0+/upload/oa-social-login/includes/communication.php#L44

    You could use this hook to store the data:
    http://docs.oneall.com/plugins/guide/social-login-wordpress/#3a

    Here a an example (untested):

    function oa_social_login_store_extended_data ($user_data, $identity)
    {
        if ($identity->provider == 'twitch')
        {
            update_user_meta ($user_data->ID, 'access_token', $identity->source->access_token_key);
        }
    }
    
    //This action is called whenever Social Login adds a new user
    add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2);
    
  • To get an OAuth token for Twitch, first, register your application on the https://dev.twitch.tv/console by logging in, clicking "Applications," and filling out the necessary details like Name, OAuth Redirect URLs, and Category. After creating the application, you'll receive a Client ID and Client Secret.

    For Mixer (now known as Facebook Gaming), visit the Facebook for Developers site to register your application. Log in, create a new app, and complete the setup process. You'll then be provided with an App ID and App Secret. Use these credentials to follow the OAuth flow for obtaining an access token for authentication and accessing the platform's API.

  • edited October 8

    To get OAuth tokens for Twitch, use the Twitch Authentication API by registering your app and following their flow. For Mixer, now integrated with Facebook, you’ll need to use Facebook's OAuth API. You might need custom PHP code or an OAuth plugin to manage this in WordPress.

  • Hi,

    Thank you for reaching out and for using our plugin for your new site, www.mvp-arena.com or https://wormzonemodi.com/!

    Regarding your request, our WordPress plugin currently does not retrieve OAuth tokens for third-party platforms like Twitch and Mixer by default. However, you can extend the plugin's functionality by hooking into the user login process and using Twitch's and Mixer's OAuth APIs to retrieve the required token. You may need to register your app with these platforms and configure the OAuth flow accordingly.

    Let us know if you need more guidance on setting this up.

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.