Skip to main content

SecurityScopes

This is a special class that you can define in a parameter in a dependency to obtain the OAuth2 scopes required by all the dependencies in the same chain. This way, multiple dependencies can have different scopes, even when used in the same path operation. And with this, you can access all the scopes required in all those dependencies in a single place.

Attributes

AttributeTypeDescription
scopeslist[str]The list of all the scopes required by dependencies.
scope_strstrAll the scopes required by all the dependencies in a single string separated by spaces, as defined in the OAuth2 specification.

Constructor

Signature

def SecurityScopes(
scopes: list[str]| None = None
) - > null

Parameters

NameTypeDescription
scopes`list[str]None` = None

Signature

def SecurityScopes(
scopes: list[str]| None = None
) - > null

Parameters

NameTypeDescription
scopes`list[str]None` = None