MCPcopy Create free account
hub / github.com/UiPath/uipathcli / callAuthenticator

Function callAuthenticator

auth/oauth_authenticator_test.go:381–403  ·  view source on GitHub ↗
(context AuthenticatorContext)

Source from the content-addressed store, hash-verified

379}
380
381func 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
405func createConfidentialAuthContext(baseUrl url.URL) AuthenticatorContext {
406 config := map[string]interface{}{

Calls 5

AuthMethod · 0.95
NewFileCacheFunction · 0.92
NewExecCustomProcessFunction · 0.92
NewOAuthAuthenticatorFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected