Azure-Samples / Azure-Samples/azure-sdk-for-go-samples

Cannot install azidentity module

Open
#359 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
308
Forks
186
PR merge metrics
No merged PRs in 30d

Description

## This issue is a: (mark with an `x`)

- [x] bug report
- [ ] request for new sample
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

## Steps to reproduce:
go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity

## Errors and log messages:
```
# github.com/Azure/azure-sdk-for-go/sdk/azidentity
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go:47:10: cannot use confidential.Client{} (value of type confidential.Client) as type confidentialClient in return statement:
confidential.Client does not implement confidentialClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...confidential.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go:51:10: cannot use confidential.Client{} (value of type confidential.Client) as type confidentialClient in return statement:
confidential.Client does not implement confidentialClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...confidential.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go:59:9: cannot use confidential.New(clientID, cred, o...) (value of type confidential.Client) as type confidentialClient in return statement:
confidential.Client does not implement confidentialClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...confidential.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go:85:66: cannot use c (variable of type public.Client) as type publicClient in struct literal:
public.Client does not implement publicClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...public.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go:94:59: cannot use public.WithSilentAccount(c.account) (value of type interface{public.AcquireSilentOption; options.CallOption}) as type public.AcquireTokenSilentOption in argument to c.client.AcquireTokenSilent
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go:63:60: cannot use c (variable of type public.Client) as type publicClient in struct literal:
public.Client does not implement publicClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...public.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go:71:59: cannot use public.WithSilentAccount(c.account) (value of type interface{public.AcquireSilentOption; options.CallOption}) as type public.AcquireTokenSilentOption in argument to c.client.AcquireTokenSilent
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go:79:17: cannot use public.WithRedirectURI(c.options.RedirectURL) (value of type interface{public.AcquireInteractiveOption; options.CallOption}) as type public.InteractiveAuthOption in argument to append
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go:99:44: cannot use c (variable of type confidential.Client) as type confidentialClient in struct literal:
confidential.Client does not implement confidentialClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...confidential.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go:46:85: cannot use c (variable of type public.Client) as type publicClient in struct literal:
public.Client does not implement publicClient (wrong type for AcquireTokenByAuthCode method)
have AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...public.AcquireByAuthCodeOption) (base.AuthResult, error)
want AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireTokenByAuthCodeOption) (base.AuthResult, error)
src/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go:46:85: too many errors
```

## Expected behavior:
Usually stuff doesn't break until it comes to run/compile time this seems to break by even just installing it.....
I'm also new to golang and have no idea what I'm doing so I don't really know what's meant to happen other then it going and installing the module into the src/github.com folder or something I think.

## OS and Go versions:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

Linux RIS-dnMTJ7JOORJ 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

GOVERSION="go1.18.1"

## Further info:
I can install other module like github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute totally fine.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity` under Go 1.18.1, then inspect the listed files in `sdk/azidentity`, especially `azidentity.go` and the credential implementations, alongside the incompatible client method signatures in the error. Done means the azidentity module installs or compiles successfully and its existing tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go
Domain
authentication, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.