Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9906
Closed
Open
Issue created Jul 06, 2021 by Administrator@rootContributor

[BUG] [Dart-dio] Basic Auth not working

Created by: laurensfischer

Description

The generated Basic Auth Interceptor does not work when defining basic auth as authentication scheme according to https://swagger.io/docs/specification/authentication/basic-authentication/

The interceptor looks for authInfo with type 'basic' getAuthInfo(options, 'basic'); while the requests are generated like this:

'secure': <Map<String, String>>[
          {
            'type': 'http',
            'name': 'basicAuth',
          },
openapi-generator version

5.1.1

OpenAPI declaration file content or url
openapi: 3.0.3
...
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
security:
  - basicAuth: []
Generation Details

Generated for dart-dio-next, should be the same for dart-dio. openapi-generator generate -i api.json -g dart-dio-next -c config.json -o . --skip-validate-spec

Steps to reproduce

Generate Code with basic Auth, call setBasicAuth('basicAuth','username', 'password' ), send a request.

Suggest a fix

Match type in BasicAuthInterceptor and in generated requests.

Assignee
Assign to
Time tracking