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

Onshape provider endpoints are not up to date #469

Closed
koliyo opened this issue Aug 25, 2020 · 5 comments · Fixed by #470
Closed

Onshape provider endpoints are not up to date #469

koliyo opened this issue Aug 25, 2020 · 5 comments · Fixed by #470
Assignees
Milestone

Comments

@koliyo
Copy link

koliyo commented Aug 25, 2020

Describe the bug
When using the AspNet.Security.OAuth.Onshape provider with the default endpoint values I get invalid_grant response.

See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/blob/dev/src/AspNet.Security.OAuth.Onshape/OnshapeAuthenticationDefaults.cs

By using these updated endpoint declarations I get proper auth flow:

        .AddOnshape(options => {
          IConfigurationSection outhConfig =
              Configuration.GetSection("Authentication:Onshape");

          options.ClientId = outhConfig["ClientId"];
          options.ClientSecret = outhConfig["ClientSecret"];
          options.UserInformationEndpoint = "https://cad.onshape.com/api/users/sessioninfo";
          options.AuthorizationEndpoint = "https://oauth.onshape.com/oauth/authorize";
          options.TokenEndpoint = "https://oauth.onshape.com/oauth/token";
        })

ie cad.onshape.com -> oauth.onshape.com

@martincostello
Copy link
Member

Thanks for letting us know @koliyo - I'll look at updating the provider and pushing a new version later today or tomorrow 👍

@martincostello martincostello added this to the 3.1.4 milestone Aug 25, 2020
@martincostello martincostello self-assigned this Aug 25, 2020
martincostello added a commit to martincostello/AspNet.Security.OAuth.Providers that referenced this issue Aug 25, 2020
Update the URLs used by the Onshape provider to resolve aspnet-contrib#469.
martincostello added a commit that referenced this issue Aug 25, 2020
Update the URLs used by the Onshape provider to resolve #469.
@martincostello
Copy link
Member

HI @koliyo - an updated version of the package, 3.1.4-preview.20425.44, is now available from our MyGet feed.

Would you be able to try it out in your application and verify it resolves your need to override the URLs on the options?

Now you should be able to just go back to:

.AddOnshape(options => {
    IConfigurationSection outhConfig =
        Configuration.GetSection("Authentication:Onshape");

    options.ClientId = outhConfig["ClientId"];
    options.ClientSecret = outhConfig["ClientSecret"];
})

@martincostello
Copy link
Member

Hi @koliyo - were you able to validate the fix for the Onshape provider?

@martincostello
Copy link
Member

As you've not provided any feedback I'm going to assume it works.

@martincostello
Copy link
Member

This fix is now available in version 3.1.4 of the provider.

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

Successfully merging a pull request may close this issue.

2 participants