(context AuthenticatorContext)
| 379 | } |
| 380 | |
| 381 | func callAuthenticator(context AuthenticatorContext) (url.URL, chan AuthenticatorResult) { |
| 382 | loginChan := make(chan string) |
| 383 | authenticator := NewOAuthAuthenticator(cache.NewFileCache(), BrowserLauncher{ |
| 384 | Exec: process.NewExecCustomProcess(0, "", "", func(name string, args []string) { |
| 385 | switch runtime.GOOS { |
| 386 | case "windows": |
| 387 | loginChan <- args[1] |
| 388 | default: |
| 389 | loginChan <- args[0] |
| 390 | } |
| 391 | }), |
| 392 | }) |
| 393 | |
| 394 | resultChannel := make(chan AuthenticatorResult) |
| 395 | go func(context AuthenticatorContext) { |
| 396 | result := authenticator.Auth(context) |
| 397 | resultChannel <- result |
| 398 | }(context) |
| 399 | |
| 400 | loginUrl := <-loginChan |
| 401 | url, _ := url.Parse(loginUrl) |
| 402 | return *url, resultChannel |
| 403 | } |
| 404 | |
| 405 | func createConfidentialAuthContext(baseUrl url.URL) AuthenticatorContext { |
| 406 | config := map[string]interface{}{ |
no test coverage detected