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

Add HTTP basic auth login. #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mekacher-Anis
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2024

CLA assistant check
All committers have signed the CLA.

@@ -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 {
Copy link
Collaborator

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?

Copy link
Author

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 {
Copy link
Collaborator

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?

Copy link
Author

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{})
Copy link
Collaborator

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?

Copy link
Author

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 {
Copy link
Collaborator

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?

Copy link
Author

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.

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

Successfully merging this pull request may close these issues.

3 participants