Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Customize login soy-template from plugin

Roman Bubiakin _Wombats Corp_ December 19, 2016

Hi All

I'm developing SSO button plugin and everething is ready.

Here how my Login page looks like:

938c938aa96b485bb4e33ff7e6d1eb02[1].png

I did this customization by injecting custom div directly into ../static/page/login/login.soy

<div class="field-group" style="border-bottom: 1px dotted #ccc; margin-bottom:20px; padding-bottom:20px;">
			<center>
				<label for="sso_login" style="display:block;">Single Sign-On</label>
				<input class="aui-button aui-button-primary" type="submit" value="SSO Login" id="sso_login" name="sso_login" onclick="location.href='https://****.com/saml2/idp/sso';">
			</center>
		</div>

And this is it what I don't like.

Here is Atlassian documentation about related theme: Customizing the Login Page but it recomends direct customization on server sad

Is it possible to put my div into soy w/o customization on server side?

Thank you!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Felix
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2016

Hi Roman, 

there is a web panel available for plugin use called bitbucket.notification.banner.footer. You can see all the web panels on a page by adding "web.panels" as a query parameter to the URL.

The downside is that this web panel is below the login box. If you don't mind, then that's an option.

The page you posted relates to Confluence and does not apply to Bitbucket.

By the way: there are many SSO plugins already available for Bitbucket on the Atlassian Marketplace, including the official Atlassian SAML for Data Center plugin.

 

Felix

Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2016

Note that the "bitbucket.notification.banner.footer" plugin point Felix mentions is on every page - not just the login page. If you want to add your div only to the login page, you'd have to add a <condition class="" /> to your panel that checks the URL from the request it gets provided and only displays itself on the login page. Alternatively, you can do this logic in JS and insert the div wherever you like if the JS determines that it is on the login page. (although keep in mind that our DOM is not API and doing this could cause your plugin to break after an update if we change our DOM).

Felix's suggestion of using an off the shelf solution could be a better way to go.

Another option might be to use a <servlet-filter> to completely replace the login page with one you control (though this could end up being far more work and might be more brittle).

Additionally, if you'd like us to add a plugin point specifically to the login page (which would greatly simplify your plugin), you can create a Suggestion in the BSERV project for us to add it in a future release (but that won't help you now unfortunately).

Roman Bubiakin _Wombats Corp_ December 19, 2016

Guys!

I'm impressed by your answers, so fast and so full!

 

You can see all the web panels on a page by adding "web.panels" as a query parameter to the URL.

Thank a lot for this very useful feature!
By the way, I've tested the same on jira,confluence and crowd and seems that it's work only for bitbucket, am I right?
official Atlassian SAML for Data Center plugin

Will test it right now. Seems that it's new plugin and thats why I did miss it.

Does not support stash sad so I will proceed with my own implementation smile

@Felix Haehnel, @Adam Ahmed thanks a lot!

Like Roma Bubyakin likes this
Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2016

Just FYI that "Bitbucket Server" is the new name for Stash since 4.0 - same product. If you are still in your license period, you should be able to upgrade for free. Do note that SAML is only supported on our Data Center licenses at the moment - not Server licenses.

TAGS
AUG Leaders

Atlassian Community Events