Comments (12)
I have the same problem and therefore looked at the source code:
# ./lib/python3.8/site-packages/privacyidea/webui/login.py:161
login_text = Match.action_only(g, action=ACTION.LOGIN_TEXT, scope=SCOPE.WEBUI) \
.action_values(unique=True, allow_white_space_in_action=True, write_to_audit_log=False)
if len(login_text) and list(login_text)[0] and sub_state not in [1, 2]:
login_text = list(login_text)[0]
else:
login_text = ""
login_text
is apparently only set if sub_state
has neither the value 1
nor the value 2
.
sub_state
is defined here using subscription_status()
:
# ./lib/python3.8/site-packages/privacyidea/webui/login.py:143
sub_state = subscription_status()
And subscription_status()
is this:
# ./lib/python3.8/site-packages/privacyidea/lib/subscriptions.py:93
def subscription_status(component="privacyidea", tokentype=None):
"""
Return the status of the subscription
0: Token count <= 50
1: Token count > 50, no subscription at all
2: subscription expired
3: subscription OK
:return: subscription state
"""
...
Conclusion
login_text
can only be used if there are less than 50 tokens or if there is an active subscription.
from privacyidea.
Thank you for filing an issue and sharing your observations or ideas. Please be sure to provide as much information as possible to help us to work on this issue.
from privacyidea.
Hi @gerdesj i can not reproduce this. The login text is properly displayed. Did You reload the browser-tab? The text gets pulled in on fresh (re-)load of the page, after that it isn't changed.
from privacyidea.
I've tried multiple browser and their private mode and another two computers that have never seen our PI. I'll (re)double check the policies, given you can't reproduce. There must be something odd on my instance.
Thank you for your time.
from privacyidea.
@gerdesj How does your policy look like in detail? Note, that the login text can not e.g. handle realms, users and resolvers for reasons.
from privacyidea.
@gerdesj How does your policy look like in detail? Note, that the login text can not e.g. handle realms, users and resolvers for reasons.
It is two simple plain text words. I've just tried removing it and adding in something random - no change.
I'm now looking to see where form-signin-heading gets piLoginText from ...
from privacyidea.
I've checked what the action column for the policy looks like in the database and login_text is set correctly and changes when I update the policy in the web UI. I changed the token_page_size and user_page_size in the web UI and that took effect.
from privacyidea.
Hi @gerdesj Do You use a customized index.html
? The login text gets injected into the index.html
before it is send to the browser.
Can You verify that there is something like
<input type=hidden id="LOGIN_TEXT" value="the login text">
in the index.html
sent from the server?
from privacyidea.
I have not customized index.html. The main part of it looks like this on disc - /opt/privacyidea/lib/python3.10/site-packages/privacyidea/static/templates/index.html:
<input type=hidden id=REMOTE_USER value="{{ remote_user }}">
...
<input type=hidden id="LOGIN_TEXT" value="{{ login_text }}">
...
<input type=hidden id=PI_TRANSLATION_WARNING value="{{ translation_warning }}">
and that includes the input you mention. I see the same in dev tools in my browser.
from privacyidea.
and that includes the input you mention. I see the same in dev tools in my browser.
So when viewing the main page in the dev-tools there is a line <input id="LOGIN_TEXT" type=hidden value="Your custom text">
?
But the custom text is not displayed?
We use JavaScript to extract the custom text and insert it here:
privacyidea/privacyidea/static/components/login/views/login.html
Lines 50 to 53 in 5f8be0f
It looks like the variable
piLoginText
is not initialized properly here:Do You have any messages in the the dev-tools console?
from privacyidea.
The only messages in the console are:
InstallTrigger is deprecated and will be removed in the future. constants.js:50:14
This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.
I'm not an expert with dev tools 8) I have found loginControllers.js?v=20240112T233317 in the sources tab in dev tools. That code is on line 76-77 here and not 70-71 as within your comment.
(Edit) Also in the html output I can see in body:
<input type="hidden" id="LOGIN_TEXT" value="" autocomplete="off">
The value is blank.
from privacyidea.
I have the same problem and therefore looked at the source code:
...
Conclusion
login_text
can only be used if there are less than 50 tokens or if there is an active subscription.
Well spotted. I have a fix and I think we can safely mark this issue as: "working as intended".
from privacyidea.
Related Issues (20)
- Failure accessing from different networks - PyO3 modules may only be initialized once per interpreter process HOT 4
- Parameter confusion between "user" and "username" in POST /user/ request
- dpkg: error processing package privacyidea-apache2 (--configure) HOT 2
- E: The repository 'http://lancelot.netknights.it/community/bionic/stable focal Release' does not have a Release file. HOT 1
- Label policies for PUSH token enroll via validate/check
- Allow to change the text during multichallenge enrollment
- EventHandler: Order of stacking with policies
- Additional Event Condition: Result->Authentication
- Fix policy description
- 2 person login HOT 3
- Mark privacyidea token in the qr code
- Can't connect via ldap-proxy plugin HOT 6
- Development environment fails to upgrade the DB schema in regards to nodes. HOT 3
- Email format validation during enroll via multichallenge HOT 1
- Support button: Create support request HOT 1
- Add index to Challenge.expiration column HOT 2
- Wrong confirmDelete() call in JS
- Wrong text during enrolling email via multichallenge
- Error in web UI when an unexpected entry is encountered during generation of a drop-down list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from privacyidea.