fastapi_aad_auth._base.state¶
Authentication State Handler.
- class fastapi_aad_auth._base.state.AuthenticationState(**kwargs)[source]¶
Authentication State.
Initialise the logger.
- property authenticated_user¶
Get the authenticated user.
- check_groups(required_groups: Optional[Union[List[str], str]] = None)[source]¶
Check if the user has the required roles.
- check_roles(required_roles: Optional[Union[List[str], str]] = None)[source]¶
Check if the user has the required roles.
- check_scopes(required_scopes: Optional[Union[List[str], str]] = None)[source]¶
Check if the user has the required scopes.
- property credentials¶
Get the credentials object.
- classmethod load(serializer: itsdangerous.url_safe.URLSafeSerializer, encoded_state: Optional[str] = None)[source]¶
Load from encoded state.
- Parameters
serializer -- Serializer object containing the en/decoding secrets
- Keyword Arguments
encoded_state -- The encoded state to be decoded
- classmethod load_from_session(serializer: itsdangerous.url_safe.URLSafeSerializer, session)[source]¶
Load from a session.
- classmethod logout(serializer: itsdangerous.url_safe.URLSafeSerializer, session)[source]¶
Clear the sessions state.
- class fastapi_aad_auth._base.state.InteractiveUser(username: str, name: str, email: str, roles: Optional[List[str]] = None, groups: Optional[List[str]] = None, scopes: Optional[List[str]] = None)[source]¶
User for interactive components through Starlette.
Initialise the user.
- class fastapi_aad_auth._base.state.User(**kwargs)[source]¶
User Model.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- property klass¶
Return the user klass information for loading from a session.
- property permissions¶
User Permissions.