Commit Graph
41 Commits
Author SHA1 Message Date
Adilet Maratov 50daf7463d Solves problem with Github authentication restriction by organization membership when the organization's access policy is set to "Access restricted". "Access restricted" policy should not stop user to authenticate.
How it is solved:
* Take organizations_url field data from user basic data response
* Make another request to get all organization the user is a member of (public membership)
* Authenticate user if appropriate organization found in that list
2017-12-07 16:13:49 +06:00
Matt Bostock 16c5d0e4b7 Always verify TLS unless explicitly told otherwise
TLS was not being verified in a number of places:

- connections to grafana.com

- connections to OAuth providers when TLS client authentication was
  enabled

- connections to self-hosted Grafana installations when using the CLI
  tool

TLS should always be verified unless the user explicitly enables an
option to skip verification.

Removes some instances where `InsecureSkipVerify` is explicitly set to
`false`, the default, to help avoid confusion and make it more difficult
to regress on this fix by accident.

Adds a `--insecure` flag to `grafana-cli` to skip TLS verification.

Adds a `tls_skip_verify_insecure` setting for OAuth.

Adds a `app_tls_skip_verify_insecure` setting under a new `[plugins]`
section.

I'm not super happy with the way the global setting is used by
`pkg/api/app_routes.go` but that seems to be the existing pattern used.
2017-10-06 17:09:27 +01:00
Dave Hall 0c70d271dc Support large github organisations (#8846)
* Add new HttpGetResponse struct type
* Modify HttpGet() return to use HttpGetResponse
* Look up _all_ the teams the user is a member of
2017-07-31 12:13:29 +02:00
Dan Cech 8422697199 centralize oauth http calls, validate response status (#8470) 2017-05-26 14:35:32 +02:00
Torkel Ödegaard c34db77f04 grafana_com: changed name of oauth grafana_net integration (old settings names still work), and updated login button look, closes #8415 2017-05-22 14:56:50 +02:00
Dan Cech 665cf55e6e make generic oauth provider flexible enough to handle bitbucket's oauth implementation (#8248) 2017-05-02 14:37:56 +02:00
Dan Cech b489e93d94 Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log

* add util.SplitString to handle space and/or comma-separated config lines

* go fmt
2017-04-25 09:14:29 +02:00
Alexander Menzhinsky 30c334a2b8 Add common type for oauth authorization errors 2017-02-01 16:42:59 +03:00
huydx adb441e5c8 (format) run go fmt in pkg 2016-12-14 12:17:38 +09:00
Eric Uldall 658fc1a67a added hosted domain suppport to google oauth login (#6372) 2016-10-28 12:00:47 +02:00
Eric Uldall 9468ddeed5 Issues/6317 empty google login (#6318)
* added Login property to google_oauth model

* fixed spacing

* fixed google_oauth syntax error, missing comma before newline

* set noexpandtab for commit
2016-10-19 07:43:32 +02:00
Dan Cech 6b16fcea52 Oauth2 Updates (#6226)
* break out go and js build commands

* support oauth providers that return errors via redirect

* remove extra call to get grafana.net org membership

* removed GitHub specifics from generic OAuth

* readded ability to name generic source

* revert to a backward-compatible state, refactor and clean up

* streamline oauth user creation, make generic oauth support more generic
2016-10-11 08:51:44 +02:00
Torkel Ödegaard e5fc4332cd feat(oauth): refactoring PR #6077 2016-09-28 15:10:50 +02:00
Dan Cech 630a8ed8aa support setting default org role when adding user via grafana.net auth 2016-09-20 12:36:36 -04:00
Dan Cech fc17ed351c support logging in with grafana.net credentials 2016-09-19 16:48:07 -04:00
bergquist 53dddf1a8f fix(oauth): remove github refs from generic auth 2016-09-07 10:55:46 +02:00
bergquist 3b6820ef03 feat(oauth): create struct for generic oauth and add config values 2016-09-07 10:34:56 +02:00
Kevin Fitzpatrick f2baa5b210 Make Generic OAuth Configs ENV VARS-friendly
Use underscores instead of dashes.
2016-06-30 15:07:55 -07:00
Kevin Fitzpatrick b4646b6c3a Allow users to use a generic oauth that conforms to the github style.
Enables users to set their own link text.
2016-06-30 15:07:55 -07:00
Don Thapa b345c7cf46 gofmt happiness 2015-11-07 11:32:06 -06:00
Don e16bbc660d use [auth.github] -> api_url property; supports git enterprise 2015-11-07 00:06:15 -06:00
Andrea Bernardo Ciddio cf147cdeaf GitHub users without a public email should be authenticated using their primary private email address 2015-05-28 16:47:20 +01:00
Indrek Juhkam b55d9350e7 Add github organizations support 2015-05-23 17:06:51 +03:00
Torkel Ödegaard 884dc53f8a smalĺ refactorings 2015-04-29 09:49:33 +02:00
Garrett Bjerkhoel eb37fc089b Check for active team membership when fetching s.UserInfo 2015-04-28 20:22:21 -07:00
Garrett Bjerkhoel 979d0ca70f Add new error type for team membership permissions 2015-04-28 20:21:44 -07:00
Garrett Bjerkhoel 7ea579bb71 Add team_ids configuration option 2015-04-28 20:19:48 -07:00
Jason Harvey ddaac50a25 Add allow_sign_up override for auth.google/github. 2015-04-16 13:43:18 -08:00
William Wei b7c0d99cdf get google api url from config file
instead of using https://www.googleapis.com/oauth2/v1/userinfo in
code.
2015-04-15 18:11:54 +08:00
Torkel Ödegaard e9afd30b47 Updated changelog with, Github OAuth: Now works with Github for Enterprise, thanks @williamjoy 2015-04-15 10:31:56 +02:00
William Wei 4fd2622e55 grafana/grafana#1781 add oauth api url as config
read github api from config file instead of using public github:
http://api.github.com/user

this would be useful when you are using github enterprise edition
2015-04-15 14:18:10 +08:00
William Wei d048e39cde grafana/grafana#1781 add oauth api url as config 2015-04-15 14:03:28 +08:00
Torkel Ödegaard eb575685aa OAuth: Specify allowed email address domains for google or and github oauth logins, Closes #1660 2015-04-06 14:16:22 +02:00
Torkel Ödegaard b8c378f2f0 Updated golang/x/oauth2 dependency, #1710 2015-04-04 09:50:25 +02:00
Torkel Ödegaard 10820f31c2 Changed go package path 2015-02-05 10:37:13 +01:00
Torkel Ödegaard 95305e7e11 Changed from goconfig to its new counter part go-ini 2015-01-27 10:09:54 +01:00
Torkel Ödegaard 35326e1d92 Worked a little on anonymous access, needs more work 2015-01-07 16:37:24 +01:00
Torkel Ödegaard e9fcca16bd updated to new golang/x/oauth2 2014-12-30 10:10:13 +01:00
Torkel Ödegaard 50164324f3 moved back to a main.go file in root 2014-11-28 11:51:34 +01:00
Torkel Ödegaard d7cd2b970e OAuth remake 2014-10-07 17:56:37 -04:00
Torkel Ödegaard 450d242d5f working on oauth 2014-10-07 15:54:38 -04:00