Skip to content
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

Expose authorization response error code for better debugging #167

Closed
yuwaMSFT2 opened this issue Sep 7, 2017 · 3 comments
Closed

Expose authorization response error code for better debugging #167

yuwaMSFT2 opened this issue Sep 7, 2017 · 3 comments
Assignees

Comments

@yuwaMSFT2
Copy link

We are doing ARM calls with AAD service principal authorization

This could fail with authentication. Right now the returned error has information like below:
autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/xxxxxxxxx/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400

autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/xxxxxxxxx/oauth2/token?api-version=1.0 failed with 401 Unauthorized: StatusCode=401

However there are many reasons that Graph API can give you 400. Is it possible to expose the additional error code from the response?

@yuwaMSFT2
Copy link
Author

@sajayantony @sivagms

@marstr
Copy link
Member

marstr commented Sep 14, 2017

Howdy Folks, this is something that drives me crazy too. I believe that #170 should address this. If not, I'll try to add something in. It's been on my mental backlog for a long time.

@jhendrixMSFT
Copy link
Member

This should be fixed in go-autorest v9.5.0. Please re-open if you still experience this issue with v9.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants