question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.6.0 beta 1 Swagger & Auth

See original GitHub issue

API Platform version(s) affected: 2.6.0 beta1

Description
When I try to perform an operation via Swagger using authentication an error is thrown in the Swagger side edge and the request is not executed. Everything is going well via Postman. Everything is fine without authentication on Swagger

How to reproduce
On Swagger perform an action without authentication and try to do this same action by providing the token

Additional Context
Error Swagger:

09:07:30.769 system.js:464 TypeError: Cannot read property 'call' of undefined
    at t.request (build-request.js:102)
    at xr (build-request.js:19)
    at Object.Or [as buildRequest] (index.js:266)
    at actions.js:431
    at utils.js:195
    at bindActionCreators.js:3
    at wrap-actions.js:33
    at Object.r (system.js:174)
    at Object.executeRequest (system.js:461)
    at actions.js:474

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
juliencharpentiercommented, Dec 23, 2020

Same thing here. supportsNormalization from SwaggerDecorator returns false instead of true.

1reaction
wulsiccommented, Jan 21, 2021

You could use the new decorator methods as described by API-Platform for 2.6 https://api-platform.com/docs/master/core/jwt/

In case you don’t like this method, you could always just decorate the new api_platform.openapi.normalizer service.

    App\OpenApi\JwtDecorator:
        decorates: 'api_platform.openapi.normalizer'
        arguments: ['@.inner']
        autoconfigure: false

It still uses the Swagger Normalizer.

api_platform.openapi.normalizer               alias for "api_platform.openapi.normalizer.api_gateway"
api_platform.openapi.normalizer.api_gateway   ApiPlatform\Core\Swagger\Serializer\ApiGatewayNormalizer
Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication - Swagger
OpenAPI uses the term security scheme for authentication and authorization schemes. OpenAPI 3.0 lets you describe APIs protected using the following ...
Read more >
tsed-swagger-with-authorization - CodeSandbox
VS Code's tsserver was deleted by another application such as a misbehaving virus detection tool. Please reinstall VS Code. Manage Extension.
Read more >
API Documentation using Swagger 3 with Spring Boot 2 + ...
Want to document your APIs for the spring boot 2 application? Well, it's pretty simple using Open API specification. Swagger is an open-source...
Read more >
hapi-swaggered-ui - npm
Easy swagger-ui drop-in plugin for hapi to be used with hapi-swaggered. ... 5 years ago. 3.0.0-beta.0. 1. 5 years ago. 2.6.0.
Read more >
IdentityServer4.AccessTokenValidation 2.6.0 - NuGet
NET Core authentication handler to validate JWT and reference tokens from ... NET Framework 4.6.1 ... AccessTokenValidation --version 2.6.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found