Skip to main content
Question

Change the login button link/pop up

  • September 14, 2021
  • 7 replies
  • 184 views

mefarazath

My requirement is kind of simple :)

I am trying to enable OpenID connect based login for insided forum. The current behaviour is that even if OpenID connect based login is the only option available, clicking on the “Login” button opens up a popup similar to below.

 

Click on Login

 

Popup

Instead what I want is to directly take the user to my OpenID Connect identity provider when the user click on the login button.

The behaviour I expect is similar to https://community.zapier.com/ where the link on the Login Button directly takes the user to https://community.zapier.com/ssoproxy/login?ssoType=oauth2 which I assume is a similar URL the browser would take me if I select the OpenID connect option from the pop up.

I edited the login button in the browser (HTML editing) and it worked as expected. ie, I linked the button to take me to OpenID connect provider.

 

What would be the cleanest approach to do this?
Is it possible to modify the login button link directly?


TIA

 

7 replies

SmartlyGreg
Forum|alt.badge.img
  • Helper ⭐️⭐️⭐️
  • December 9, 2021

I’ve tried to do this too but I think I’ve missed something as nothing happens upon clicking with this script:

<script> 
var loginButton = document.getElementsByClassName("header-login-button");
loginButton[0].setAttribute('href', '/topic/new');
loginButton[0].removeAttribute('data-modal');
loginButton[0].setAttribute('class', 'header-login-button qa-header-login-button btn btn--secondary');
</script>

(Using topic/new to test...)

And yet the resulting code looks exactly the same as what is on the Zapier community login button!?!?! I’d love some input!


olimarrio
Forum|alt.badge.img+5
  • Gainsight Employee ⭐️
  • December 9, 2021

Hi @mefarazath & @SmartlyGreg :wave: ,

 

Yes we can modify the login button URL from our side, which is probably the cleanest approach. This is probably why your script isn’t working as expected @SmartlyGreg - it is getting overridden by some configuration behind the scenes.

 

If you let me know the URLs you would like this button to point to, I will happily make the change to your community’s configuration. You’re welcome to reply here or if you prefer, you can also submit a ticket to support@insided.com.

 

Thanks


mefarazath
  • Author
  • Contributor ⭐️⭐️
  • December 13, 2021

@SmartlyGreg 

This is what I have currently under ‘Third Party Scripts’ → ‘Before </Body>’

<script>
// Mutator observer to check for changes in the login modal and kick of SSO flow
function callback(mutationList, observer) {
if (inSidedData.user.role === 'roles.guest') {
window.location = '/ssoproxy/login?ssoType=openidconnect&returnUrl=' + encodeURIComponent(window.location.href);
}
}

const targetNode = document.querySelector(".qa-login-modal");
const observerOptions = {
childList: true,
attributes: true,

// Omit (or set to false) to observe only changes to the parent node
//subtree: true
}

const observer = new MutationObserver(callback);
observer.observe(targetNode, observerOptions);
</script>

 

Actually this script was added by the insided support team. Based on which login type you are planning for SSO you can change the ssoType parameter.

 

 


SmartlyGreg
Forum|alt.badge.img
  • Helper ⭐️⭐️⭐️
  • December 15, 2021

Thanks @mefarazath that is super helpful!


  • Contributor ⭐️⭐️⭐️⭐️
  • October 17, 2024

Similar question here, forgive me if the answer is in the thread already and I just don’t recognize it 😅

 

We use SSO for our community logins and I’m curious about the best way to edit or remove the “Social Login” text. I see where I can edit the other phrases in “Phrases”, but not sure about that specific text. 


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • October 21, 2024

Hi @jwren - that phrase should be:

Module: Common

Key: sso.title


jvdc
  • Helper ⭐️⭐️⭐️
  • May 6, 2025

Thanks!