@@ -29,11 +29,11 @@ letting `go-redis-entraid` fetch and renew the authentication tokens for you aut
29
29
Install [ ` go-redis ` ] ({{< relref "/develop/clients/go" >}}) if you
30
30
have not already done so.
31
31
32
- From a Go module folder, install ` go-redis-entraid ` with the
32
+ Install ` go-redis-entraid ` with the
33
33
following command:
34
34
35
35
``` bash
36
- go get github.com/redis-developer /go-redis-entraid
36
+ go get github.com/redis/go-redis-entraid
37
37
```
38
38
39
39
## Create a ` StreamingCredentialsProvider ` instance
@@ -84,16 +84,16 @@ import (
84
84
.
85
85
provider , err := entraid.NewConfidentialCredentialsProvider (
86
86
entraid.ConfidentialIdentityProviderOptions {
87
- CredentialsProviderOptions : entraid. CredentialsProviderOptions {
88
- ClientID: " <your-azure-client-id>" ,
89
- } ,
90
- CredentialsType : identity.ClientSecretCredentialType ,
91
- ClientSecret : " <your-azure-client-secret> " ,
92
- Authority : identity.AuthorityConfiguration {
93
- AuthorityType: identity. AuthorityTypeDefault ,
94
- TenantID: " <your-azure-tenant-id> " ,
95
- },
96
- }
87
+ ConfidentialIdentityProviderOptions : identity. ConfidentialIdentityProviderOptions {
88
+ ClientID: " <your-azure-client-id>" ,
89
+ ClientSecret: " <your-azure-client-secret> " ,
90
+ CredentialsType: identity.ClientSecretCredentialType ,
91
+ Authority: identity. AuthorityConfiguration {
92
+ AuthorityType : identity.AuthorityTypeDefault ,
93
+ TenantID: " <your-azure-tenant-id> " ,
94
+ } ,
95
+ },
96
+ },
97
97
)
98
98
```
99
99
@@ -118,13 +118,12 @@ import (
118
118
.
119
119
.
120
120
provider , err := entraid.NewManagedIdentityCredentialsProvider (
121
- entraid.ManagedIdentityCredentialsProviderOptions {
122
- CredentialsProviderOptions : entraid.CredentialsProviderOptions {
123
- ClientID: " <your-azure-client-id>" ,
124
- },
125
- ManagedIdentityType : identity.UserAssignedIdentity ,
126
- UserAssignedClientID : " <your-user-assigned-client-id>" ,
127
- },
121
+ entraid.ManagedIdentityCredentialsProviderOptions {
122
+ ManagedIdentityProviderOptions : identity.ManagedIdentityProviderOptions {
123
+ ManagedIdentityType: identity.UserAssignedObjectID ,
124
+ UserAssignedObjectID: " <your-user-assigned-client-id>" ,
125
+ },
126
+ },
128
127
)
129
128
```
130
129
@@ -135,7 +134,6 @@ configuration using the `TokenManagerOptions` field of `CredentialsProviderOptio
135
134
136
135
``` go
137
136
options := entraid.CredentialsProviderOptions {
138
- ClientID : os.Getenv (" AZURE_CLIENT_ID" ),
139
137
TokenManagerOptions : manager.TokenManagerOptions {
140
138
ExpirationRefreshRatio: 0.7 ,
141
139
LowerRefreshBounds: 10000 ,
@@ -213,12 +211,12 @@ func main() {
213
211
)
214
212
}
215
213
216
- // Create credentials provider
214
+ // Create credentials provider for system assigned identity
217
215
provider , err := entraid.NewManagedIdentityCredentialsProvider (
218
216
entraid.ManagedIdentityCredentialsProviderOptions {
219
- CredentialsProviderOptions: entraid. CredentialsProviderOptions {
220
- ClientID: clientID ,
221
- },
217
+ ManagedIdentityProviderOptions: identity. ManagedIdentityProviderOptions {
218
+ ManagedIdentityType: identity. SystemAssignedIdentity ,
219
+ },
222
220
}
223
221
)
224
222
if err != nil {
0 commit comments