Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Can't find "oidc" auth provider #6

Closed
mehdideveloper opened this issue Dec 6, 2018 · 3 comments
Closed

Can't find "oidc" auth provider #6

mehdideveloper opened this issue Dec 6, 2018 · 3 comments

Comments

@mehdideveloper
Copy link

Hey
I tried running the tool on my but it gives me this error:

...
Testing for unauthenticated access...
panic: No Auth Provider found for name "oidc"

which happens inside the `kubernetes.NewForConfig" call.

I checked my config file and it actually contains an auth provider called oidc

@knisbet
Copy link
Contributor

knisbet commented Dec 6, 2018

Hi,

Sorry, right now the tool only works when using mutual TLS for authenticating with the apiserver.

@jeromefroe
Copy link
Contributor

I also ran into this issue, though in my case the missing Auth Provider was GCP. Based on this comment, it seems that client-go doesn't include all auth providers by default, but one can import them as needed:

// Import just the GCP provider.
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// Or import all providers.
_ "k8s.io/client-go/plugin/pkg/client/auth"

I added the latter import to main.go and when I re-ran the tool I got the following error:

$ go run main.go
# github.com/gravitational/cve-2018-1002105/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:246:4: cannot use expiresIn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:247:4: cannot use expiresOn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:248:4: cannot use expiresOn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:265:23: cannot use token.token.ExpiresIn (type json.Number) as type string in assignment
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:266:23: cannot use token.token.ExpiresOn (type json.Number) as type string in assignment

Some more googling led me to the following update for Gopkg.toml:

[[override]]
name = "github.com/Azure/go-autorest"
revision = "bca49d5b51a50dc5bb17bbf6204c711c6dbded06"

After running dep ensure to update the dependencies I was able to run the tool successfully. Hopefully that helps!

@knisbet
Copy link
Contributor

knisbet commented Dec 6, 2018

PR's welcome...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants