How to use the guardpost.asynchronous.authentication.AuthenticationStrategy function in guardpost

To help you get started, we’ve selected a few guardpost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RobertoPrevato / BlackSheep / blacksheep / server / application.py View on Github external
def use_authentication(self, strategy: Optional[AuthenticationStrategy] = None) -> AuthenticationStrategy:
        if self.started:
            raise RuntimeError('The application is already running, configure authentication '
                               'before starting the application')
        if not strategy:
            strategy = AuthenticationStrategy()

        self._authentication_strategy = strategy
        return strategy