-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[REQ] Better authentication support to C# generators #2352
Comments
To add better OAuth support to aspnetcore, Lines 51 to 103 in 0eb385c
|
@wing328, In order to do this we'll probably need to keep track of whether the security is being set at a global level or on a specific API resource. We'll also need to add specific packages if bearer/oauth is being used at all, particularly on the client side. |
I think we've taken care of this. The security definition in the endpoint level has already taken into account the global setting.
Yup, we can use
Please elaborate with an example. |
Do we just need to add packages then?
From: William Cheng <notifications@github.com>
Sent: 28 March 2019 16:45
To: OpenAPITools/openapi-generator <openapi-generator@noreply.github.com>
Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Comment <comment@noreply.github.com>
Subject: Re: [OpenAPITools/openapi-generator] [REQ] Better authentication support to C# generators (#2352)
In order to do this we'll probably need to keep track of whether the security is being set at a global level or on a specific API resource
I think we've taken care of this. The security definition in the endpoint level has already taken into account the global setting.
We'll also need to add specific packages if bearer/oauth is being used at all, particularly on the client side.
Yup, we can use {{#hasOAuthMethods}} ... {{/hasOAuthMethods}}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2352 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fgeUIZgezT-OvlWM2sai3TkovDzIks5vbPGVgaJpZM4bnYk6>.
|
Sorry I still don't understand the question. We can start with cloning the existing ASP.net Core 2.x generator and make it works with ASP.NET Core 3.0 cc @A-Joshi |
I wouldn’t necessarily just clone the existing one, as there are plenty of things we might want to enable, such as the new json serializer.
From: William Cheng <notifications@github.com>
Sent: 30 March 2019 01:21
To: OpenAPITools/openapi-generator <openapi-generator@noreply.github.com>
Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Comment <comment@noreply.github.com>
Subject: Re: [OpenAPITools/openapi-generator] [REQ] Better authentication support to C# generators (#2352)
Do we just need to add packages then?
Sorry I still don't understand the question. We can start with cloning the existing ASP.net Core 2.x generator and make it works with ASP.NET Core 3.0
cc @A-Joshi<https://github.com/A-Joshi>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2352 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fiRQK7okr1W_N03nG170ZUBjpDECks5vbrwOgaJpZM4bnYk6>.
|
What do we need to do to get auth working in C#? |
@wing328 I'm getting back in to development and able to look at this. |
Which C# generators? Again clientConfiguration.mustache#L51-L103 is a good starting point, which has better authentication support. |
Line 1196 in c88174e
That's the only line I found related to OpenIDConnect support and I agree with you we should support that as well. |
@wing328 That makes sense from a client perspective, is there a sample server that implements authentication? From looking at the C# asp.net core stuff, I don't think we support any authentication at all, so my question is how is authentication surfaced in properties within the generators on either an individual path, a specific http verb of a path (books/get) for example and then the whole API. Once I understand all of this/have referenced code to look at, I should be able to crack on with authentication schemes in the next few days. I need this for a project asap. |
I'm using aspnetcore generator (server generator) I have added this into my controller mustache at the method level
This works fine when I have one scope. But I'd like to use the scopes defined on each method in the specification. |
This would be really nice to have! |
Is your feature request related to a problem? Please describe.
Add Bearer authentication support to C# generators
References:
The text was updated successfully, but these errors were encountered: