File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ import (
14
14
type CredentialsProviderOptions struct {
15
15
// ClientID is the client ID of the identity.
16
16
// This is used to identify the identity when requesting a token.
17
+ //
18
+ // Deprecated: This field is not used and will be removed in a future version.
19
+ // The ClientID should be part of the IdentityProvider options (e.g. ConfidentialIdentityProviderOptions, not the CredentialsProviderOptions)
20
+ // There is a ClientID in the ConfidentialIdentityProviderOptions and ManagedIdentityProviderOptions.
17
21
ClientID string
18
22
19
23
// TokenManagerOptions is the options for the token manager.
@@ -96,6 +100,12 @@ type ConfidentialCredentialsProviderOptions struct {
96
100
// It uses client id and client credentials to authenticate with the identity provider.
97
101
// The client credentials can be either a client secret or a client certificate.
98
102
func NewConfidentialCredentialsProvider (options ConfidentialCredentialsProviderOptions ) (auth.StreamingCredentialsProvider , error ) {
103
+ // If the client ID is not provided in the confidential identity provider options, use the one from the credentials provider options.
104
+ // Those are duplicated and should be the same.
105
+ if options .ConfidentialIdentityProviderOptions .ClientID == "" {
106
+ options .ConfidentialIdentityProviderOptions .ClientID = options .CredentialsProviderOptions .ClientID
107
+ }
108
+
99
109
// Create a new identity provider using the client ID and client credentials.
100
110
idp , err := identity .NewConfidentialIdentityProvider (options .ConfidentialIdentityProviderOptions )
101
111
if err != nil {
You can’t perform that action at this time.
0 commit comments