Select any folder, click the Auth tab on the right, and choose Security Scheme as the authentication type.
2
Select the desired Security Scheme from the dropdown menu.
3
If you choose OAuth 2.0 as the security scheme, you can further select the required Scopes.
Security schemes configured at the folder level will apply to all subfolders and endpoints under that folder, unless they have their own auth configuration.
Configuring Security Schemes at the Endpoint Level#
1
Select any endpoint and go to the Edit tab on the right. At the Request section, choose Security Scheme as the authorization type.
2
Select the desired Security Scheme from the dropdown menu.
3
If you choose OAuth 2.0 as the security scheme, you can further select the required Scopes.
Auth settings configured at the endpoint level will override those at the folder level.
Security scheme only define the auth method. You still need to provide actual auth values when debugging endpoints.To avoid repeatedly filling in auth values during endpoint debugging, Apidog allows you to set default auth values. Once set, these defaults are used automatically during debugging, unless manually overridden. If a folder has default auth values configured, all endpoints under it can use them.
1
Choose a security scheme from the list and set a Default Auth Values.
Apidog supports configuring multiple security schemes for a single endpoint, which aligns with the multiple authentication types mechanisms defined in the OpenAPI spec:
AND: Security schemes combined via AND must be used simultaneously in the same request (coming soon).
OR: Security schemes combined via OR are alternatives β any one can be used in the given context.
Use the + button in the Auth settings to add more security schemes.
According to the OpenAPI spec, when creating an OAuth 2.0 security scheme, all possible Scopes should be defined. When using it in an endpoint, you must select the required scopes.To make things easier, Apidog allows you to set default scopes at the folder level. These defaults will apply to all endpoints in the folder β unless you manually set different scopes at the endpoint level.
1
In the endpoint's Auth settings, select OAuth 2.0.
2
Under the Scopes section, you can view all available scopes defined by the security scheme and select the ones needed.
3
If the endpoint inherits scopes from a parent folder, you can click Reset the scopes to the configuration of the parent folder to revert to the parent configuration.
Debugging Endpoints with OAuth 2.0 Security Scheme#
You can pre-configure a token as the default value for OAuth 2.0 security scheme, so you don't need to obtain a new token every time you debug an API.
Getting Token at the Folder Level as the Default Auth Value#
1
Select a folder, go to the Auth tab, choose an OAuth 2.0 security scheme, select scopes and grant type, then click Get Token.
2
In the pop-up panel:
Enter the client ID, client secret, etc.
Click Continue
3
After getting the token, you can view its details, including when it expires. This token can be used across all endpoints in the folder.
Getting Token at the Endpoint Level as the Default Auth Value#
1
Select the desired endpoint, go to Edit, choose an OAuth 2.0 security scheme, and click Get Token.
2
In the pop-up panel:
Enter the client ID, client secret, etc.
Click Continue
3
Complete the authorization to get a token
The token will be used for debugging this endpoint
Using a Default Token or Generating a New One for Endpoint Debugging#
When debugging an endpoint in Apidog, you have two options to apply an auth token:
When running an endpoint, go to the Auth tab under the Run panel. Select Use Parent Default Auth Values. The default auth token configured in the parent folder will be automatically applied to the endpoint request.