0
0
Rest APIprogramming~10 mins

Authentication documentation in Rest API - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the authentication type in the API documentation.

Rest API
securitySchemes:
  ApiKeyAuth:
    type: [1]
    in: header
    name: X-API-KEY
Drag options to blanks, or click blank then click option'
Ahttp
Boauth2
CopenIdConnect
DapiKey
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'http' or 'oauth2' instead of 'apiKey' for API key authentication.
2fill in blank
medium

Complete the code to define the OAuth2 flow type in the authentication documentation.

Rest API
securitySchemes:
  OAuth2Auth:
    type: oauth2
    flows:
      [1]:
        authorizationUrl: https://example.com/auth
        tokenUrl: https://example.com/token
        scopes:
          read: Grants read access
Drag options to blanks, or click blank then click option'
AclientCredentials
BauthorizationCode
Cpassword
Dimplicit
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'clientCredentials' or 'password' flows with 'authorizationCode'.
3fill in blank
hard

Fix the error in the HTTP authentication scheme name.

Rest API
securitySchemes:
  BasicAuth:
    type: http
    scheme: [1]
Drag options to blanks, or click blank then click option'
Abasic
Bdigest
Cbearer
Doauth
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bearer' or 'oauth' instead of 'basic' for Basic Auth.
4fill in blank
hard

Fill both blanks to define a Bearer token authentication scheme with the correct type and scheme.

Rest API
securitySchemes:
  BearerAuth:
    type: [1]
    scheme: [2]
Drag options to blanks, or click blank then click option'
Ahttp
BapiKey
Cbearer
Doauth2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apiKey' as type for Bearer tokens.
Confusing 'oauth2' with Bearer scheme.
5fill in blank
hard

Fill all three blanks to define an OAuth2 implicit flow with the correct type, flow, and authorization URL.

Rest API
securitySchemes:
  OAuth2Implicit:
    type: [1]
    flows:
      [2]:
        authorizationUrl: [3]
        scopes:
          write: Grants write access
Drag options to blanks, or click blank then click option'
Aoauth2
Bimplicit
Chttps://example.com/oauth/authorize
DauthorizationCode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'authorizationCode' flow instead of 'implicit'.
Wrong authorization URL format.