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

OAuth2 Authorization Header not added to requests with form data parameters #403

Closed
nastassiar opened this issue Jun 22, 2015 · 3 comments
Closed

Comments

@nastassiar
Copy link

Hi,
I am using Swashbuckle.Core 5.2.1 and I am having issues with OAuth2 authentication with requests that have form data parameters.

The only thing different about the requests that don't work is is they have form-data. They are API calls for uploading images, but I don't see why how this would cause them to lose their authorization headers.

I am using an IOperationFilter to add the form-data parameters
It seems that adding the parameter is what is causing the issue:

                operation.parameters.Add(new Parameter
                {
                    name = "file",
                    required = true,
                    type = "file",
                    @in = "formData"
                }
                );

When I don't apply the filter the authorization header is sent, but obviously then there is no form-data.

Anyone else had a similar problem? Or am I adding the form-data parameter incorrectly?

@nastassiar nastassiar changed the title OAuth2 Authorization Header not added to some requests OAuth2 Authorization Header not to requests with form data parameters Jun 23, 2015
@nastassiar
Copy link
Author

Oh sorry this is basically a duplicate of swagger-api/swagger-ui#1249 will the fix in swagger-ui be merged into Swashbuckle.Core anytime soon? Or should I just not use the nuget package?

@nastassiar nastassiar changed the title OAuth2 Authorization Header not to requests with form data parameters OAuth2 Authorization Header not added to requests with form data parameters Jun 23, 2015
@aidapsibr
Copy link

Is this still pending a release?

@domaindrivendev
Copy link
Owner

See 5.3.1

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