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

Upgrade Autodesk to v2 #764

Merged
merged 6 commits into from Aug 7, 2023
Merged

Conversation

EMostafaAli
Copy link
Contributor

Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution - just some minor code style comments.

Have you verified that these changes work as expected in a real application with the Autodesk v2 API?

@martincostello martincostello linked an issue Apr 16, 2023 that may be closed by this pull request
@kevinchalet
Copy link
Member

Note: you forgot to update the address of the userinfo endpoint to use the v2 userinfo API. See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/pull/788/files.

@EMostafaAli
Copy link
Contributor Author

Isn't it done as per the following screenshot?
image

@kevinchalet
Copy link
Member

@EMostafaAli I don't see this change in this PR:

image

Are you sure you pushed the changes to the correct branch?

(also, you'll likely need to update the claim mapping in the options class)

@EMostafaAli
Copy link
Contributor Author

My bad, I was looking at different code. I will try to make the changes quickly.

@EMostafaAli
Copy link
Contributor Author

@kevinchalet , updated the user info endpoint

@kevinchalet
Copy link
Member

@EMostafaAli it looks like you didn't fix the points mentioned by @martincostello. We'll also need you to fix #764 (comment) before being able to merge this PR.

@EMostafaAli
Copy link
Contributor Author

@kevinchalet, I hope this new commit addresses your comments.

@martincostello
Copy link
Member

The tests are failing.

@EMostafaAli
Copy link
Contributor Author

@martincostello, Done

Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

I'll leave @martincostello decide what to do next, as this PR is technically a breaking behavior change, given the claims are changing 😃

using var requestMessage = new HttpRequestMessage(HttpMethod.Post, Options.TokenEndpoint);
requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(
$"{Options.ClientId}:{Options.ClientSecret}"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the standard way of computing the Authorization: Basic [...] header requires formURL-encoding the client identifier and client secret individually before computing their base64 representation. That said, I see in the Autodesk docs that they don't mention formURL-encoding so their implementation is probably not 100% compliant. Let's keep it this way.

@martincostello martincostello added this to the 7.0.3 milestone Aug 7, 2023
@martincostello martincostello merged commit a75b8f9 into aspnet-contrib:dev Aug 7, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Autodesk v2
4 participants