(httpClient *http.Client, server string)
| 309 | } |
| 310 | |
| 311 | func getOpenIdConfiguration(httpClient *http.Client, server string) (*OpenIdConfigurationResponse, error) { |
| 312 | openIdConfigurationEndpoint := fmt.Sprintf("%s/.well-known/openid-configuration", server) |
| 313 | |
| 314 | resp, err := httpClient.Get(openIdConfigurationEndpoint) |
| 315 | |
| 316 | if err != nil { |
| 317 | return nil, err |
| 318 | } |
| 319 | |
| 320 | body, err := io.ReadAll(resp.Body) |
| 321 | if err != nil { |
| 322 | return nil, err |
| 323 | } |
| 324 | sb := string(body) |
| 325 | |
| 326 | var openIdConfiguration OpenIdConfigurationResponse |
| 327 | |
| 328 | err = json.Unmarshal([]byte(sb), &openIdConfiguration) |
| 329 | |
| 330 | if err != nil { |
| 331 | return nil, err |
| 332 | } |
| 333 | return &openIdConfiguration, nil |
| 334 | } |
| 335 | |
| 336 | func getInputs(configProvider config.IConfigProvider, flags *LoginFlags, isPromptEnabled bool, ask question.Asker, cmd *cobra.Command) (*LoginInputs, error) { |
| 337 | server := flags.Server.Value |
no test coverage detected