swagger-api / swagger-api/swagger-codegen

[csharp-client] authentication does not implemented

Open
#5,121 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: C-Sharp General: Question help wanted Issue: Security
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I have security description in my swagger, but I haven't found any security implementations in the client.

Swagger-codegen version

last commit from github

Swagger declaration file content or url
 securityDefinitions: 
     apiKey: 
         type: 'apiKey' 
         description: 'API Key Authentication' 
         name: 'apiKey' 
         in: 'header' 
     oauth2: 
         type: 'oauth2' 
         description: 'OAuth2 Implicit Grant' 
         flow: 'implicit' 
         authorizationUrl: 'http://petstore.swagger.wordnik.com/api/oauth/dialog' 
         tokenUrl: 'https://tempuri.org/token' 
         scopes: 
Command line used for generation
java.exe -jar $Global:swaggerJar `
    generate `
    -i $Global:swaggerJsonUrl `
    -l csharp `
    -o $Global:outputFolder `
    -c $Global:config `
    -t $Global:templates `
    --additional-properties $json.'additional-properties'`

where $global set to my variables

Suggest a Fix

I suppose it should be similar template as for java ApiKeyAuth but not sure

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Java auth/ApiKeyAuth.mustache template and compare it with the C# client templates used by the shown generation command. Check how the provided apiKey and oauth2 security definitions are represented in the generated client; done means the generated C# client has defined behavior for those authentication schemes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.