We would like to edit Main Login Page for Jira to have a link for users to SSO login

I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2019

What we would like is to have 2 login options on the main login page.
We need to keep the existing login for the non-SAML login users.
We also need a button or link to the SAML login for all the SSO users.

I found this link 


But the details in this link I don't see the files the should be modify. 


2 answers

0 votes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 15, 2024
I wrote workaround by using internal Atlassian rest api, which can be UNSTABLE!.
If your Anouncement Banner is public, then you can put below script:
<script type="text/javascript">
function _clearLoginFormAndAuthorize(authorizeUrl) {
window.open(authorizeUrl, '_self');
function addAdditionalAuthenthicationsToLoginGadget() {
const elementLoginForm = document.getElementById('loginform');
if (elementLoginForm == null) {
return; //login form on loaded page does not exists, so do nothing
type: 'GET',
url: AJS.contextPath() + '/rest/authconfig/1.0/login-options',
success: function(data){
const filteredData = data.results.filter(currentData => currentData.type.toUpperCase() !== 'LOGIN_FORM');
if (filteredData.length === 0) {
let additionalAuthenticationSection = document.createElement('div');
additionalAuthenticationSection.setAttribute('id', 'additional-authentication-section');
for (const currentData of filteredData) {
const elementButton = document.createElement('button');
elementButton.innerHTML = currentData['button-text'];
elementButton.setAttribute('data-authentication-method', currentData.type.toLowerCase()); //this attribute is in html DOM login page
elementButton.setAttribute('onclick', '_clearLoginFormAndAuthorize("' + currentData['login-link'] + '")');
elementButton.setAttribute('type', 'button');
elementButton.setAttribute('class', 'aui-button aui-button-primary');
elementButton.setAttribute('style', 'margin-top:10px; margin-right:10px; display:block');
const elementLoginForm = document.getElementById('loginform');
if (elementLoginForm != null) {
elementLoginForm.parentElement.parentElement.style.height = 'auto'; //resize login gadget
window.onload = function(){
If your annoucement banner is private then you need modify login.soy by follow with instruction [https://confluence.atlassian.com/jirakb/customize-jira-login-page-225122084.html].
You can adding above script, but you need adjust this by adding {literal} soy element or just replace all open brackets ({) to {lb} and closed brackets ({) to {rb}.
Moreover, you need change section window.onload to direct invoke addAdditionalAuthenthicationsToLoginGadget();
0 votes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 14, 2020

This question is relevant for Jira 8.7.1 still in April 2020. Our admins cannot configure SAML auth as primary auth, because the method it Solved: How to disable SAML 2.0 in Jira Data Center 8.2 when we can't log in for manually setting SAML back to secondary does not work.

My interim solution for adding to the login page a link for the SAML authentication is to modify the announcement banner.

if(window.location.href.indexOf("login.jsp") != -1)
document.write("<div class='aui-message info'><p>");
document.write("<a href='/plugins/servlet/external-login'>Click here to log in with SSO</a>");

 The javascript logic for determining if we are on the login page is courtesy of one of my fellow admins who probably found it somewhere in this community site.

Suggest an answer

Log in or Sign up to answer