microsoft / microsoft/kiota

Kiota CLI does not generate Authentication and token endpoints according to the provided open api spec

Open
#6,757 1 comment 0 reactions 0 assignees View on GitHub
Csharp documentation type:documentation
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### What are you generating using Kiota, clients or plugins?

API Client/SDK

### In what context or format are you using Kiota?

Nuget tool

### Client library/SDK language

Csharp

### Describe the bug

I am trying to generate Kiota Client Code for the Etsy api linked below using the kiota cli
The Authentication and token endpoint is not listed in the generated code but is essential for sending the requests! Will not be usable without.

Image

and here you can see the linked spec is defintly including the missing to be generated parts:

Image

### Expected behavior

Should generate this parts like all others, so we can get the required oAuth2 flow.

should include or provide anything like this documentation shown:

https://learn.microsoft.com/de-de/openapi/kiota/authentication?tabs=csharp

### How to reproduce

create new class library projet, net 9, csharp
use for example this command:
`kiota generate --language csharp --openapi https://www.etsy.com/openapi/generated/oas/3.0.0.json --class-name EtsyClient --namespace-name DevTKSS.Clients.EtsyClient`
will do the same for every other namespace name I tryed

### Open API description file

https://www.etsy.com/openapi/generated/oas/3.0.0.json

### Kiota Version

1.28.0+57130b1b1db3bc5c060498682f41e20c8ae089f2

### Latest Kiota version known to work for scenario above?(Not required)

never worked!!!

### Known Workarounds

! generated code is not usable without this included !

### Configuration

windows 11
visual studio 2022 community edition PS Dev Terminal in IDE

### Debug output

already inserted in #6756

### Other information

the Documentation is including no information for the auth flow if the api requres oauth2, its just telling that we need a custom auth provider, which is not really helpfull for someone who is new to http and kiota and auth. please add this if possible

https://github.com/unoplatform/uno.extensions/pull/2807
https://github.com/unoplatform/uno.extensions/issues/2792

https://github.com/microsoft/kiota/issues/3776
https://github.com/microsoft/kiota/issues/3019

https://github.com/microsoft/kiota/blob/main/authentication/README.md

auth part is missing as How To Guide in the docs here:

Image

all we get is microsoft identity platform authentication information:

Image

Its good that microsoft does provide a identity auth, but this should not be the absolutly only option. Some links could help maybe?
and just to add for your repo maintainers:
your "authentication of kiota with azure" linked Repository in the authentication/README.md file, is archived:
https://github.com/microsoft/kiota-authentication-azure-dotnet
maybe you could consider things if you do, that are not archived, as I as user would not assume archived refereces to be up to date at all.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with the Kiota 1.28.0 CLI command and Etsy OpenAPI document, then compare the generated C# client with the authentication and token paths in the specification. Review the linked authentication documentation and related issues to separate generator behavior from missing guidance; done means the expected OAuth-related output or documented limitation is clear and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, authentication, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.