Does it work with Pantheon.io ?

Drupal version: Drupal 8
Host: pantheon.io

Detailed explanation:

- Preliminary -
Installed and configured plugin according to the official guide by plugin developer (https://docs.oneall.com/plugins/guide/social-login-drupal/8/).
Created OneAll account and Twitch.tv custom application according to the instructions provided by the plugin creators.
In Drupal on plugin config page "Verify API settings" - green result (all good).

- Operation -
Part 1, registering: no problem.
When a new (anonymous) user goes to /user/login and clicks "Login with Twitch", he is prompted with Twitch.tv access permission and then after agreeing is redirected back to the original site as already logged in.

Part 2, login again: PROBLEM.
When an anonymous user goes to /user/login and clicks "Login with Twitch" and then auto-approved by Twitch.tv and getting redirected back to the site, I get an error (URL = http://endpointd3548105.chios.panth.io:12256/user/login):

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
__ .__
___________ _____/ |_| |__ ____ ____ ____
\____ \__ \ / \ __\ | \_/ __ \/ _ \ / \
| |_> > __ \| | \ | | Y \ ___( <_> ) | \
| __(____ /___| /__| |___| /\___ >____/|___| /
|__| \/ \/ \/ \/ \/


There was an error on an SSL connection.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Best Answer

  • Answer ✓
    I already got a fix from Pantheon.io guys that works, I am putting it below, may be it will help you in the future.

    Upon checking social media codes, I found out:

    social_login.module: $request_port = ((!empty($_SERVER['SERVER_PORT']) AND $_SERVER['SERVER_PORT'] <> '80') ? (":" . $_SERVER['SERVER_PORT']) : '');
    social_login.module: $redirect_to = $request_protocol . $_SERVER['SERVER_NAME'] . $request_port . $request_uri;

    Pantheon has a server/infrastructure value for $_SERVER["SERVER_NAME"] and $_SERVER['SERVER_PORT'] . Since the redirect is going elsewhere. So you need to put this code at the bottom of your settings.php

    $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
    if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
    if (isset($_SERVER['HTTP_X_SSL']) && $_SERVER['HTTP_X_SSL'] != 'ON') {
    $_SERVER['SERVER_PORT'] = 443;
    }
    else {
    $_SERVER['SERVER_PORT'] = 80;
    }
    }

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    H Anthony,

    could you please post a link to your website so that I can reproduce and test the error?

    Regards,
  • Great. Thanks for sharing.

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.