How to use the adal.oauth2_client.OAuth2Client function in adal

To help you get started, we’ve selected a few adal 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 AzureAD / azure-activedirectory-library-for-python / tests / test_username_password.py View on Github external
def create_oauth2_client_stub(self, authority, token_response, err):
            authorityObject = Authority(authority, False)
            authorityObject.token_endpoint = AADConstants.TOKEN_ENDPOINT_PATH
            authorityObject.device_code_endpoint = AADConstants.DEVICE_ENDPOINT_PATH
            client = OAuth2Client(cp['callContext'], authorityObject)

            def side_effect (oauth):
                return token_response
            client.get_token = mock.MagicMock(side_effect=side_effect)

            return client
github AzureAD / azure-activedirectory-library-for-python / tests / test_api_version.py View on Github external
def test_api_version_is_set(self):
        client = adal.oauth2_client.OAuth2Client(
            {"api_version": "1.0", "log_context": mock.Mock()}, self.authority)
        self.assertIn('api-version=1.0', client._create_token_url().geturl())
github AzureAD / azure-activedirectory-library-for-python / adal / token_request.py View on Github external
def _create_oauth2_client(self):
        return oauth2_client.OAuth2Client(self._call_context, 
                                          self._authentication_context.authority)
github AzureAD / azure-activedirectory-library-for-python / adal / code_request.py View on Github external
def _create_oauth2_client(self):
        return oauth2_client.OAuth2Client(
            self._call_context,
            self._authentication_context.authority)

adal

Note: This library is already replaced by MSAL Python, available here: https://pypi.org/project/msal/ .ADAL Python remains available here as a legacy. The ADAL for Python library makes it easy for python application to authenticate to Azure Active Directory (AAD) in order to access AAD protected web resources.

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages