You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
To support 'service principal' with certificate, ADAL depends on the 'cryptography' package. For smooth installation, some suggestions:
11
+
The ADAL for Python library enables python applications to authenticate with Azure AD and get tokens to access Azure AD protected web resources.
10
12
11
-
* For Windows and macOS
13
+
You can learn in detail about ADAL Python functionality and usage documented in the [Wiki](https://github.com/AzureAD/azure-activedirectory-library-for-python/wiki).
12
14
13
-
Upgrade to the latest pip (8.1.2 as of June 2016) and just do `pip install adal`.
15
+
## Installation and Usage
14
16
15
-
* For Linux
17
+
You can find the steps to install and basic usage of the library under [ADAL Basics](https://github.com/AzureAD/azure-activedirectory-library-for-python/wiki/ADAL-basics) page in the Wiki.
16
18
17
-
Upgrade to the latest pip (8.1.2 as of June 2016).
18
-
19
-
You'll need a C compiler, libffi + its development headers, and openssl + its development headers.
20
-
Refer to [cryptography installation](https://cryptography.io/en/latest/installation/)
21
-
22
-
* To install from source:
23
-
24
-
Upgrade to the latest pip (8.1.2 as of June 2016).
25
-
To avoid dealing with compilation errors from cryptography, first run `pip install cryptography` to use statically-linked wheels.
26
-
Next, run `python setup.py install`
27
-
28
-
If you still like to build from source, refer to [cryptography installation](https://cryptography.io/en/latest/installation/).
29
-
For more context, start with this [stackoverflow thread](http://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py).
30
-
31
-
### Acquire Token with Client Credentials
32
-
33
-
In order to use this token acquisition method, you need to configure a service principal. Please follow [this walkthrough](https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/).
34
-
35
-
Find the `Main logic` part in the [sample](sample/client_credentials_sample.py#L46-L55).
36
-
37
-
### Acquire Token with client certificate
38
-
A service principal is also required.
39
-
Find the `Main logic` part in the [sample](sample/certificate_credentials_sample.py#L55-L64).
40
-
41
-
### Acquire Token with Refresh Token
42
-
Find the `Main logic` part in the [sample](sample/refresh_token_sample.py#L47-L69).
43
-
44
-
### Acquire Token with device code
45
-
Find the `Main logic` part in the [sample](sample/device_code_sample.py#L49-L54).
46
-
47
-
### Acquire Token with authorization code
48
-
Find the `Main logic` part in the [sample](sample/website_sample.py#L107-L115) for a complete bare bones web site that makes use of the code below.
49
-
50
-
## Logging
51
-
52
-
#### Personal Identifiable Information (PII) & Organizational Identifiable Information (OII)
53
-
54
-
Starting from ADAL Python 0.5.1, by default, ADAL logging does not capture or log any PII or OII. The library allows app developers to turn this on by configuring the `enable_pii` flag on the AuthenticationContext. By turning on PII or OII, the app takes responsibility for safely handling highly-sensitive data and complying with any regulatory requirements.
19
+
## Samples and Documentation
20
+
We provide a full suite of [sample applications on GitHub](https://github.com/azure-samples?utf8=%E2%9C%93&q=active-directory&type=&language=) to help you get started with learning the Azure Identity system. This includes tutorials for native clients and web applications. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect and for calling APIs such as the Graph API.
55
21
56
-
```python
57
-
//PIIorOII logging disabled. Default Logger does not capture anyPIIorOII.
58
-
auth_context = AuthenticationContext(...)
22
+
You can find the relevant samples by scenarios listed in this [wiki page for acquiring tokens using ADAL Python](https://github.com/AzureAD/azure-activedirectory-library-for-python/wiki/Acquire-tokens#adal-python-apis-for-corresponding-flows).
The documents on [Auth Scenarios](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-scenarios#application-types-and-scenarios) and [Auth protocols](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-openid-connect-code) are recommended reading.
63
25
64
-
## Samples and Documentation
65
-
We provide a full suite of [sample applications on GitHub](https://github.com/azure-samples?utf8=%E2%9C%93&q=active-directory&type=&language=) and an [Azure AD developer landing page](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-developers-guide) to help you get started with learning the Azure Identity system. This includes tutorials for native clients and web applications. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect and for calling APIs such as the Graph API.
26
+
## Versions
66
27
67
-
It is recommended to read the [Auth Scenarios](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-scenarios) doc, specifically the [Scenarios section](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-scenarios#application-types-and-scenarios). For some topics about registering/integrating an app, checkout [this doc](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications). And finally, we have a great topic on the Auth protocols you would be using and how they play with Azure AD in [this doc](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-openid-connect-code).
28
+
This library follows [Semantic Versioning](http://semver.org/).
68
29
69
-
While Python-specific samples will be added into the aforementioned documents as an on-going effort, you can always find [most relevant samples just inside this library repo](https://github.com/AzureAD/azure-activedirectory-library-for-python/tree/dev/sample).
30
+
You can find the changes for each version under [Releases](https://github.com/AzureAD/azure-activedirectory-library-for-python/releases).
70
31
71
32
## Community Help and Support
72
33
@@ -80,29 +41,8 @@ If you find a security issue with our libraries or services please report it to
80
41
81
42
## Contributing
82
43
83
-
All code is licensed under the MIT license and we triage actively on GitHub. We enthusiastically welcome contributions and feedback. You can clone the repo and start contributing now.
44
+
All code is licensed under the MIT license and we triage actively on GitHub. We enthusiastically welcome contributions and feedback. Please read the [contributing guide](./contributing.md) before starting.
84
45
85
46
## We Value and Adhere to the Microsoft Open Source Code of Conduct
86
47
87
48
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
88
-
89
-
## Quick Start
90
-
91
-
### Installation
92
-
93
-
``` $ pip install adal ```
94
-
95
-
### http tracing/proxy
96
-
If you need to bypass self-signed certificates, turn on the environment variable of `ADAL_PYTHON_SSL_NO_VERIFY`
97
-
98
-
99
-
## Note
100
-
101
-
### Changes on 'client_id' and 'resource' arguments after 0.1.0
102
-
The convenient methods in 0.1.0 have been removed, and now your application should provide parameter values to `client_id` and `resource`.
103
-
104
-
2 Reasons:
105
-
106
-
* Each adal client should have an Application ID representing a valid application registered in a tenant. The old methods borrowed the client-id of [azure-cli](https://github.com/Azure/azure-xplat-cli), which is never right. It is simple to register your application and get a client id. You can follow [this walkthrough](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications). Do check out if you are new to AAD.
107
-
108
-
* The old method defaults the `resource` argument to 'https://management.core.windows.net/', now you can just supply this value explictly. Please note, there are lots of different azure resources you can acquire tokens through adal though, for example, the samples in the repository acquire for the 'graph' resource. Because it is not an appropriate assumption to be made at the library level, we removed the old defaults.
0 commit comments