swagger-api / swagger-api/swagger-codegen

Generate TypeScript Angular client library for Windows Authentication + .Net Core API

Open
#10,901 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I am creating the TypeScript Angular client library from .Net Core 5 API that is accessible by Windows Authentication.
I don't know how to configure my Swagger file to generate client library for Windows Authentication, I do not see where to apply authentication.
In order to generate the TypeScript library, I have to change to "anonymousAuthentication": true in my launchSettings.json in .Net Core 5 API. If I don't make it true, the swagger.json file is unreadable from swagger codegen.

Exception in thread "Thread-1" java.lang.IllegalArgumentException: Unable to read URL: https://localhost:44381/swagger/testProject/swagger.json
at io.swagger.codegen.v3.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:490)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:358)
at java.lang.Thread.run(Unknown Source)

Swagger-codegen version

3.0.24

Command line used for generation

java -Dlogback.configurationFile=./logback.xml -jar ../swagger-codegen/swagger-codegen-cli-3.0.24.jar generate -i https://localhost:44381/swagger/testProject/swagger.json -l typescript-angular -o npm --additional-properties ngVersion=11.1.3 -Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true

Suggest a fix/enhancement

Provide the fix or configuration on how my Windows Authenticated .Net Core 5 API be generated to TypeScript using swagger codegen

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 by reproducing the Java swagger-codegen 3.0.24 command against the reported https://localhost:44381/swagger/testProject/swagger.json URL, comparing behavior with anonymousAuthentication in launchSettings.json. Determine whether the expected fix belongs in configuration or codegen, and consider the work done when a TypeScript Angular client can be generated from the Windows-authenticated .NET Core API without enabling anonymous authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, java, openapi, typescript
Domain
api, authentication, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.