Forum Discussion

tayalaru14's avatar
tayalaru14
New Contributor
5 years ago

How to replace "bearer" in Bearer Authentication with "idtoken"

My project expects Authorization token with "idtoken" instead of "bearer". How should I implement it in open API: 3.0.1 ? Couldn't find anything in the documentation.

  1. Authorization: idtoken <token>
  • The Authorization header with a custom value prefix can be defined as an API key. The prefix (in this case - idtoken) needs to be provided as part of the token value.

    components:
      securitySchemes:
        IdToken:
          type: apiKey
          in: header
          name: Authorization
          description: Specify the token value with the `idtoken` prefix, e.g. "idtoken MYTOKEN".
    
    security:
      - IdToken: []

     

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    The Authorization header with a custom value prefix can be defined as an API key. The prefix (in this case - idtoken) needs to be provided as part of the token value.

    components:
      securitySchemes:
        IdToken:
          type: apiKey
          in: header
          name: Authorization
          description: Specify the token value with the `idtoken` prefix, e.g. "idtoken MYTOKEN".
    
    security:
      - IdToken: []