fdanard
(Franck Danard)
June 17, 2021, 8:42am
1
Hi Everyone.
I’m newbe on Discourse, and I must to change something in Login page but I don’t know where is the target and is content.
The URL looks like this: my.domain.com/auth/crowd and I get a Login page but I’m not able to edit its content.
I saw something in the discourse conf file (crowd_custom_html ) but the content is not really the same as displayed on the page.
I wonder where I can change this content.
Also, I checked if there were any redirection on /auth/crowd , Nothing (I guess).
Is someone can help me please?
Thanks
Franck
Your discourse is probably using Atlassian Crowd for sso
You should check the crowd documentation for any changes to your login page.
fdanard
(Franck Danard)
November 30, 2021, 10:31am
4
After diging further code, (I’m don’t know Ruby). it looks there something in the code which block the html content.
else
OmniAuth.config.form_css << GlobalSetting.crowd_custom_css
end
end
OmniAuth::Form.build(title: (GlobalSetting.try(:crowd_popup_title) || GlobalSetting.try(:crowd_title) || "Crowd Authentication")) do
text_field 'Username', 'username'
password_field 'Password', 'password'
html "\n<input type='hidden' name='authenticity_token' value='#{token}'/>" if token
button 'Login'
if GlobalSetting.respond_to?(:crowd_custom_html)
html GlobalSetting.crowd_custom_html
end
end.to_response
end
end
omniauth.provider :crowd,
name: 'crowd',
crowd_server_url: GlobalSetting.try(:crowd_server_url),
application_name: GlobalSetting.try(:crowd_application_name),
application_password: GlobalSetting.try(:crowd_application_password)
I imagine it’s the fact to set DISCOURSE_CROWD_CUSTOM_HTML: which will display the content here?
david
(David Taylor)
November 30, 2021, 1:50pm
5
Yes that should work - you should configure the DISCOURSE_CROWD_CUSTOM_HTML environment variable inside your app.yml file
fdanard
(Franck Danard)
November 30, 2021, 1:52pm
6
Unfortunately it doesn’t work.
Maybe the content must be enclosed with quotes?
For now, the content is not enclosed with quotes.
david
(David Taylor)
November 30, 2021, 3:17pm
7
Oh yes - I just tried it out locally and it looks like we have some issues with parsing GlobalSetting values which contain quote marks (and custom HTML will pretty much always contain quotes). I just pushed this workaround:
https://github.com/discourse/discourse-crowd/commit/7e1a690047e138c7590b040e4b1d3f4d7fb9cd5f
If you update your site, it should work much better now. Here’s an example value which now works for me:
DISCOURSE_CROWD_CUSTOM_HTML: "<a href='https://example.com' style='display: block; margin: 0.5em 0; text-align: center'>Sign up for an example.com account!</a><a style='display: block; text-align: center' href='https://example.com/forgot_password'>Forgot Password</a>"
fdanard
(Franck Danard)
November 30, 2021, 3:21pm
8
Thanks so much David.
I will update the website tomorrow.
Do that now, it’s not the good time.
Can I update the website through the GUI?
I will let you know.
david
(David Taylor)
November 30, 2021, 3:25pm
9
If you’re not changing the value in app.yml, then yes you should be able to upgrade the discourse-crowd plugin via /admin/upgrade.
fdanard
(Franck Danard)
November 30, 2021, 3:26pm
10
The forum will not be stopped?
david
(David Taylor)
November 30, 2021, 3:28pm
11
It will be just the same as any other update - there may be a few seconds/minutes of downtime/slowness while the update runs. Best to wait for a quiet time on your site if possible.
fdanard
(Franck Danard)
November 30, 2021, 3:30pm
12
Ok go it.
Thansk for all. I will let you know
fdanard
(Franck Danard)
November 30, 2021, 3:45pm
13
@david a quick question please.
I saw there’s crowd_popup_title and crowd_title .
The difference between them is, the first is displayed in a popup, and the second in a full page, right?
david
(David Taylor)
November 30, 2021, 3:51pm
14
The word ‘popup’ is a little out-of-date. We no longer use popups for authentication, so that value is in fact used as the <title> of the tab during authentication:
(i.e. this bit:)
crowd_title is used as the label on the login button (if you have multiple login methods enabled)
If you don’t supply crowd_popup_title, then crowd_title will be used for the <title> of the login tab.
fdanard
(Franck Danard)
November 30, 2021, 3:55pm
15
Ha ok.
I say that because, indeed, there’s no popup for login after update. we’ve got a full page for login right now.
BTW, is there a way to customize this page, like for example, background…Etc?
david
(David Taylor)
November 30, 2021, 4:35pm
16
Yes you can use DISCOURSE_CROWD_CUSTOM_CSS to add custom CSS rules to the page
fdanard
(Franck Danard)
December 1, 2021, 8:04am
17
Good Morning @david
That works.
Thanks so much.
I wish you a nice day.