Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme: pam_unix.so makes the login screen blank #544

Closed
msp1kpj opened this issue Sep 1, 2016 · 23 comments
Closed

Theme: pam_unix.so makes the login screen blank #544

msp1kpj opened this issue Sep 1, 2016 · 23 comments
Labels

Comments

@msp1kpj
Copy link

msp1kpj commented Sep 1, 2016

Bug report for authentic-theme 18.10 on Webmin 1.810 on CentOS 7.

When Webmin is configured NOT to use "pam_unix.so" in "/etc/pam.d/webmin" and instead uses the system's sssd configuration via "include system-auth" for all "auth/account/session" entries, the login screen is blank.

The following errors show up in the console log for both Firefox 47.0.1 and Chrome 52.0.2743.116:


SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
.success() postinit.min.js:6
n.Callbacks/i() jquery.min.js:2
n.Callbacks/j.fireWith() jquery.min.js:2
z() jquery.min.js:2
.send/c/<() jquery.min.js:2
.send() jquery.min.js:2
.ajax() jquery.min.js:2
postinit.min.js:6

1 postinit.min.js:6:3334

ReferenceError: NProgress is not defined
parent.min.js:6
1 parent.min.js:6:7954

Webmin is using "perl-Authen-PAM-0.16-16"

@iliajie
Copy link
Collaborator

iliajie commented Sep 2, 2016

Hi,

I will try to reproduce this issue and fix it in the near future.

Thanks for reporting.

@iliajie iliajie changed the title JavaScript Issues when changing Authentication PAM to system-auth Theme: pam_unix.so makes the login screen is blank Sep 2, 2016
@iliajie iliajie changed the title Theme: pam_unix.so makes the login screen is blank Theme: pam_unix.so makes the login screen blank Sep 2, 2016
@iliajie
Copy link
Collaborator

iliajie commented Sep 2, 2016

Just to double-check - if you change to Gray Theme you don't see such issue? Because if you do, it's Webmin bug.

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

That is correct. If we switch to the Gray theme the sign in works correctly.

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

Is there a way you could post a screenshot of how it looks like when error comes?

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

I can. But all or come back with is a Grey screen. Is there something else that would help more? There are JavaScript Errors, about "NProgress is not defined"

jquery.min.js?1810:2 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. VM938:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0success @ postinit.min.js?1810:6i @ jquery.min.js?1810:2fireWith @ jquery.min.js?1810:2z @ jquery.min.js?1810:2(anonymous function) @ jquery.min.js?1810:2send @ jquery.min.js?1810:2ajax @ jquery.min.js?1810:2(anonymous function) @ postinit.min.js?1810:6 VM939:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0success @ postinit.min.js?1810:6i @ jquery.min.js?1810:2fireWith @ jquery.min.js?1810:2z @ jquery.min.js?1810:2(anonymous function) @ jquery.min.js?1810:2send @ jquery.min.js?1810:2ajax @ jquery.min.js?1810:2(anonymous function) @ postinit.min.js?1810:6 parent.min.js?1810:6 Welcome to Authentic Theme 18.10 https://github.com/qooob/authentic-theme parent.min.js?1810:6 Uncaught ReferenceError: NProgress is not defined(anonymous function) @ parent.min.js?1810:6

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

Ah, ok.

What is the page's URL of the right frame? Look at the source of the iFrame to find out.

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

Here is the source code to "/session_login.cgi?logout=1", I could not find an iframe in the html source

`

<title data-initial=""></title> <script src="/webmin/unauthenticated/js/jquery.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery-ui.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.jspanel.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.scrollintoview.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/momentjs.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/bootbox.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.purl.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/bootstrap.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/bootstrap.tagsinput.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/datepicker.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/fileinput.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/codemirror.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.datatables.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.datatables.plugins.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/jquery.easypiechart.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/clipboard.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/contextmenu.min.js?1810" type="text/javascript"></script> <script src="/webmin/unauthenticated/js/init.min.js?1810" type="text/javascript"></script>

Logout successful. Use the form below to login again.

Login to Webmin
You must respond to the question below to login to Webmin server on vts-vb-a.
Username
 Continue  Clear <script type='text/javascript'> var opts = document.getElementsByClassName('ui_opt_textbox'); for(var i=0; i <script> if (window != window.top) { window.top.location = window.location; } </script>
<script src="/webmin/unauthenticated/js/postinit.min.js?1810" type="text/javascript"></script><script>___authentic_theme_footer___ = 1;</script> <script src="/webmin/unauthenticated/js/parent.min.js?1810" type="text/javascript"></script> `

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

Alright, I will take a look. Thanks.

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

It looks like the HTML is there but the JavaScript Exception is not allowing the Opacity on the "body:not(.csf):not(.e) .container-fluid " to be set to 1

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

Add the following to the /etc/webmin/authentic-theme/styles.css

body:not(.csf):not(.__e__) .container-fluid {
    pointer-events: auto;
    opacity: 0;
}

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

This path does not exist on our CentOS box. Is this a new directory or is there another path I should use?

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

I found "/usr/libexec/webmin/authentic-theme/". Would that be the correct path?

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

No. /etc/webmin/authentic-theme - create it!

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

I am not seeing that file being loaded in. I create a similar fill in the


<link href="/webmin/unauthenticated/css/bootstrap.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/bootstrap.tagsinput.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/datepicker.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/fontawesome-animation.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/codemirror.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/jquery.jspanel.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/jquery.datatables.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/nprogress.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/authentic.min.css?1810" rel="stylesheet" type="text/css">

But I added a similar file in the "/usr/libexec/webmin/authentic-theme/unauthenticated/css/styles.css" directory and it is showing.

<link href="/webmin/unauthenticated/css/bootstrap.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/bootstrap.tagsinput.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/datepicker.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/fontawesome-animation.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/codemirror.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/jquery.jspanel.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/jquery.datatables.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/nprogress.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/authentic.min.css?1810" rel="stylesheet" type="text/css">
<link href="/webmin/unauthenticated/css/styles.css?1473172711" rel="stylesheet" type="text/css">

I change the CSS to opacity 1. Is is showing the page now but the "Continue" Button does not submit the form.

body:not(.csf):not(.__e__) .container-fluid {
    pointer-events: auto;
    opacity: 1;
}

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

When doing the AJAX request for"/index.cgi/?xhr-get_theme_language=1" and "/index.cgi/?xhr-get_available_modules=1" it is bring up the "Login to Webmin" page.

@iliajie
Copy link
Collaborator

iliajie commented Sep 6, 2016

I got the reason why. I might come back a bit later with a question, otherwise I'll just fix it upon next release.

@msp1kpj
Copy link
Author

msp1kpj commented Sep 6, 2016

OK, Let me know if you need an further testing.

@iliajie
Copy link
Collaborator

iliajie commented Oct 23, 2016

What is your /etc/pam.d/webmin content?

@iliajie
Copy link
Collaborator

iliajie commented Oct 23, 2016

..I'm trying to reproduce it.

@iliajie
Copy link
Collaborator

iliajie commented Oct 23, 2016

If you run in the console __s___(); will it work?

@iliajie
Copy link
Collaborator

iliajie commented Oct 29, 2016

After 18.20 release please double check. It might be working fine. In case it doesn't PLEASE reopen this issue and will try again. I think, I fixed it (theoretially) but I don't know how to make pam_unix.so setup work quickly on my system.

In case it's not fixed, please reopen the issue and tell me how to set things up.

18.20 will be release very soon.

@iliajie iliajie closed this as completed Oct 29, 2016
@iliajie
Copy link
Collaborator

iliajie commented Oct 29, 2016

Version 18.20 is out, please upgrade.

@iliajie
Copy link
Collaborator

iliajie commented Nov 25, 2016

I could finally reproduce it and I found out that the login screen in Authentic Theme didn't even consider PAM auth.

#580

It will be working as expected in 18.30.

Why are you using PAM auth, by the way? Why not using default one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants