Skip to content

Commit

Permalink
Update pkg/resourcemanager/iam/authorizers.go
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Muirhead <christian.muirhead@microsoft.com>
  • Loading branch information
matthchr and babbageclunk committed Nov 24, 2020
1 parent 78f3654 commit 1272106
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/resourcemanager/iam/authorizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,18 @@ func GetMSITokenProviderForResource(resource string) (func() (string, error), er
return nil, err
}

return makeTokenProvider(msi), nil
}

func makeTokenProvider(msi *adal.ServicePrincipalToken) func() (string, error) {
return func() (string, error) {
err = msi.EnsureFresh()
if err != nil {
return "", err
}
token := msi.OAuthToken()
return token, nil
}, nil
}
}

func GetMSITokenProviderForResourceByClientID(resource string, clientID string) (func() (string, error), error) {
Expand Down

0 comments on commit 1272106

Please sign in to comment.