-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autorest.BearerAuthorization does not have Token
method
#150
Comments
Changing line 47 of auth/autorest.go seems to make it work properly. tokenProviders = append(tokenProviders, &servicePrincipalTokenWrapper{
tokenType: "Bearer",
tokenValue: authorizer.TokenProvider().OAuthToken(),
}) |
Hi @ekristen, thanks for reporting this and also your findings! We'll very soon be looking at tidying up the autorest wrapper and will look to incorporate this fix 👍 |
@manicminer would you like me to open a PR on this? |
Hi @ekristen, thanks, a PR would be very much appreciated! 👍 |
manicminer/hamilton-autorest#3 -- as stated on the PR, this could be wrong. The golang docs for azure sdk and the autorest stuff is not very clear IMO, but this makes this work properly for me with the autorest wrapper. |
could this fix also your issue? |
I'm passing an autorest.BearerAuthorization to the
wrappedAuth, err := auth.NewAutorestAuthorizerWrapper(authorizer)
method call but it returnscould not obtain access token from token provider
.It appears it's trying to find
.Token
method and failing. The autorest.BearerAuthorization provider only has aOAuthToken
method.Is this a bug or am I using it incorrectly?
Thanks.
The text was updated successfully, but these errors were encountered: