# Swagger/Open Api Specification - Security specification

**URL:** <https://devforum.okta.com/t/swagger-open-api-specification-security-specification/9020>\
**Category:** Questions\
**Created:** [April 22, 2020, 8:28pm UTC](https://devforum.okta.com/t/swagger-open-api-specification-security-specification/9020 "2020-04-22T20:28:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guuri11](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@Guuri11](https://devforum.okta.com/u/Guuri11)\
**Post date:** [April 22, 2020, 8:28pm UTC](https://devforum.okta.com/t/swagger-open-api-specification-security-specification/9020/1 "2020-04-22T20:28:28Z")

</div>

Hello everyone!

I’m new with Okta and I’ve made a Rest API with Symfony 5 so I’ve implemented the okta oauth that works perfect, now I’m doing the documentation with Swagger, but I don’t know how to implement the oauth in Swagger to try the endpoints from the api docs.

I’ve tried multiple things, one of them this code:

```
        // packages/nelmio_api_doc.yaml
        nelmio_api_doc:
        documentation:
            info:
              (stuff)
            components:
                securitySchemes:
                    OAuth2:
                        type: oauth2
                        flows:
                            authorizationCode:
                                authorizationUrl: https://(myurl)/oauth2/default
                                tokenUrl: https://(myurl)/oauth2/default/v1/token
                                scopes:
                                    read: Grants read access
                                    write: Grants write access
                                    admin: Grants access to admin operations
            security:
                - OAuth2:
                      - read
                      - write

```

Symfony does not return any error, but I cant try the endpoints, any suggest pls??

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 24, 2024, 7:45pm UTC](https://devforum.okta.com/t/swagger-open-api-specification-security-specification/9020/2 "2024-01-24T19:45:54Z")

</div>

Closed on January 24, 2024, 7:45pm UTC


