I am using SwaggerHub to document the API endpoints for my web application, but my app uses firebase authentication for login/register which is needed to receive a bearer token in order to perform the basic CRUD operations for the other endpoints. I am trying to figure out how to obtain the bearer token by logging in through SwaggerHub login api, but firebase authentication handles the login and register component, therefore I cannot include the endpoints that will generate the bearer token for me to test the other endpoints. The work I have so far is shown below:

LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
5th Edition
ISBN:9781337569798
Author:ECKERT
Publisher:ECKERT
Chapter14: Security, Troubleshooting, And Performance
Section: Chapter Questions
Problem 5HOP
icon
Related questions
Question

I am using SwaggerHub to document the API endpoints for my web application, but my app uses firebase authentication for login/register which is needed to receive a bearer token in order to perform the basic CRUD operations for the other endpoints. I am trying to figure out how to obtain the bearer token by logging in through SwaggerHub login api, but firebase authentication handles the login and register component, therefore I cannot include the endpoints that will generate the bearer token for me to test the other endpoints. The work I have so far is shown below:

 

swagger: '2.0'
info:
  description: An app that tracks trip activity for hikers and runners
  version: 1.0.0
  title: Journey Map
  # put the contact info for your development or API team
  contact:
    email: eminmammadzada@knights.ucf.edu
    #email2: keyoni_stallworth@knights.ucf.edu
    #email3: rasuar@knights.ucf.edu

  license:
    name: Journey Map
    url: https://journeymap-a8e65.web.app/

# tags are used for organizing operations
tags:
- name: Trips
  description: Trip operations
- name: Users
  description: User operations

paths:
  #/:
    #get:
      #security:
       # - Bearer: []
      #responses:
       # '200':
        #  description: 'Will send `Authenticated`'
        #'403': 
         # description: 'You do not have necessary permissions for the resource'
  
  /trips/{tripId}:
    get:
        description: View the details of a specific trip
        tags:
        - Trips
        produces:
        - application/json
        parameters:
        - in: path
          name: tripId
          required: true
          type: string
        security:
          - firebase_auth: []
          - Bearer: []
        responses:
            '200':
              description: success
            '400':
                description: bad request
            '403':
                description: unauthorized
            '404':
                description: trip does not exist


host: journeymap-a8e65.firebaseapp.com
schemes:
  - http
  - https
securityDefinitions:
  firebase_auth:
   type: oauth2
   flow: implicit
   authorizationUrl: https://accounts.google.com/o/oauth2/auth
   scopes: 
    user: user login
    password: user password
  Bearer:
    type: apiKey
    name: Authorization
    in: header
    description: >-
      Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Device network connection
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L