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 basic auth authentication support #2218

Closed
pabelanger opened this issue Jun 23, 2015 · 9 comments
Closed

Add basic auth authentication support #2218

pabelanger opened this issue Jun 23, 2015 · 9 comments
Milestone

Comments

@pabelanger
Copy link

Currently, grafana exposes the admin_user and admin_password in the .ini file; this is convenient. As such, I'm requesting we also expose and admin_api_key via the .ini file.

The purpose of this is to help with automated depolyments of grafana. There is no method exposed currently that allows for an initial api_key to be provisioned. Current steps require logging into GUI as admin user and manually adding it.

@torkelo
Copy link
Member

torkelo commented Jun 23, 2015

yea, I have definitely seen this pain. One other solution that I would like to do is to allow api authentication with username/pass

@pabelanger
Copy link
Author

Yup, I could see that working too

@pabelanger
Copy link
Author

Another thought would be to expose the hash / salt function to an external CLI tool. Then we can manually move the hash into the database

@torkelo
Copy link
Member

torkelo commented Jun 23, 2015

@pabelanger was thinking along similar lines

@torkelo
Copy link
Member

torkelo commented Jun 23, 2015

would be nice to not have a plain text password in the automation script

@3fr61n
Copy link

3fr61n commented Jun 27, 2015

It would be great to have the api authentication with username/pass, it would solve automation deployments

@torkelo torkelo changed the title admin_api_key configuration setting request Api auth by username/pass (useful for setup automation) Jun 29, 2015
@torkelo torkelo added this to the 2.1 milestone Jun 29, 2015
@torkelo torkelo changed the title Api auth by username/pass (useful for setup automation) Add basic auth authentication support Jun 30, 2015
@torkelo
Copy link
Member

torkelo commented Jun 30, 2015

You can now use the api with username password using a standard basic auth header (integrated into most http client libs)

❯curl -u admin http://localhost:3000/api/org
Enter host password for user 'admin':
{"id":1,"name":"Main Org."}

@torkelo
Copy link
Member

torkelo commented Jun 30, 2015

this also works,

curl http://admin:admin@localhost:3000/api/org

@3fr61n
Copy link

3fr61n commented Jul 1, 2015

Thank!!!!

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

No branches or pull requests

3 participants