-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add HTTP basic auth login. #144
base: main
Are you sure you want to change the base?
Conversation
@@ -45,7 +46,15 @@ func GrafanaKioskAnonymous(cfg *Config, messages chan string) { | |||
/* | |||
Launch chrome and look for main-view element | |||
*/ | |||
headers := make(map[string]interface{}) | |||
if len(cfg.BasicAuth.Username) != 0 && len(cfg.BasicAuth.Password) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would anonymous login require authentication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the anonymous login is for Grafana, meaning that the grafana dashboard (app) itself doesn't require authentication (user account) but it still might be hidden behind a reverse proxy that requires HTTP-Basic auth.
So I see them as two separate authentication requirements.
@@ -46,7 +47,16 @@ func GrafanaKioskAWSLogin(cfg *Config, messages chan string) { | |||
// Give browser time to load next page (this can be prone to failure, explore different options vs sleeping) | |||
time.Sleep(2000 * time.Millisecond) | |||
|
|||
headers := make(map[string]interface{}) | |||
if len(cfg.BasicAuth.Username) != 0 && len(cfg.BasicAuth.Password) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this file, this is for aws login, and doesn't use basic auth, maybe this was not intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the following comment #144 (comment)
but if u think it's not needed then I'll just remove it.
@@ -50,8 +51,17 @@ func GrafanaKioskGCOM(cfg *Config, messages chan string) { | |||
|
|||
// chromedp.WaitVisible(`//*[@href="login/grafana_com"]/i`, chromedp.BySearch), | |||
|
|||
headers := make(map[string]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this file, this is for gcom (grafana cloud) login, and doesn't use basic auth, maybe this was not intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the following comment #144 (comment)
but if u think it's not needed then I'll just remove it.
@@ -50,6 +51,11 @@ func GrafanaKioskLocal(cfg *Config, messages chan string) { | |||
log.Printf("Sleeping %d MS before navigating to url", cfg.General.PageLoadDelayMS) | |||
time.Sleep(time.Duration(cfg.General.PageLoadDelayMS) * time.Millisecond) | |||
|
|||
headers := make(map[string]interface{}) | |||
if len(cfg.BasicAuth.Username) != 0 && len(cfg.BasicAuth.Password) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this file, this is for local login (via ui interaction), and doesn't use basic auth, maybe this was not intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the following comment #144 (comment)
but if u think it's not needed then I'll just remove it.
No description provided.