Skip to content

Commit 613f389

Browse files
committed
Merge branch 'docs-staging' into dev
2 parents 7aa2078 + 10c8dd5 commit 613f389

File tree

3 files changed

+40
-23
lines changed

3 files changed

+40
-23
lines changed

docs/index.rst

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
MSAL Python documentation
1+
MSAL Python Documentation
22
=========================
33

44
.. toctree::
55
:maxdepth: 2
66
:caption: Contents:
77
:hidden:
88

9-
MSAL Documentation <https://docs.microsoft.com/en-au/azure/active-directory/develop/msal-authentication-flows>
10-
GitHub Repository <https://github.com/AzureAD/microsoft-authentication-library-for-python>
9+
index
10+
11+
..
12+
Comment: Perhaps because of the theme, only the first level sections will show in TOC,
13+
regardless of maxdepth setting.
1114
1215
You can find high level conceptual documentations in the project
1316
`README <https://github.com/AzureAD/microsoft-authentication-library-for-python>`_.
@@ -58,8 +61,8 @@ MSAL Python supports some of them.
5861
<https://github.com/AzureAD/microsoft-authentication-library-for-python/tree/dev/sample>`_.
5962

6063

61-
API
62-
===
64+
API Reference
65+
=============
6366

6467
The following section is the API Reference of MSAL Python.
6568
The API Reference is like a dictionary. You **read this API section when and only when**:
@@ -88,26 +91,32 @@ MSAL proposes a clean separation between
8891
They are implemented as two separated classes,
8992
with different methods for different authentication scenarios.
9093

94+
ClientApplication
95+
=================
96+
97+
.. autoclass:: msal.ClientApplication
98+
:members:
99+
:inherited-members:
100+
101+
.. automethod:: __init__
102+
91103
PublicClientApplication
92-
-----------------------
104+
=======================
93105

94106
.. autoclass:: msal.PublicClientApplication
95107
:members:
96-
:inherited-members:
97108

98109
.. automethod:: __init__
99110

100111
ConfidentialClientApplication
101-
-----------------------------
112+
=============================
102113

103114
.. autoclass:: msal.ConfidentialClientApplication
104115
:members:
105-
:inherited-members:
106116

107-
.. automethod:: __init__
108117

109118
TokenCache
110-
----------
119+
==========
111120

112121
One of the parameters accepted by
113122
both `PublicClientApplication` and `ConfidentialClientApplication`

msal/application.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def obtain_token_by_username_password(self, username, password, **kwargs):
156156

157157

158158
class ClientApplication(object):
159+
"""You do not usually directly use this class. Use its subclasses instead:
160+
:class:`PublicClientApplication` and :class:`ConfidentialClientApplication`.
161+
"""
159162
ACQUIRE_TOKEN_SILENT_ID = "84"
160163
ACQUIRE_TOKEN_BY_REFRESH_TOKEN = "85"
161164
ACQUIRE_TOKEN_BY_USERNAME_PASSWORD_ID = "301"
@@ -319,7 +322,7 @@ def __init__(
319322
to keep their traffic remain inside that region.
320323
321324
As of 2021 May, regional service is only available for
322-
``acquire_token_for_client()`` sent by any of the following scenarios::
325+
``acquire_token_for_client()`` sent by any of the following scenarios:
323326
324327
1. An app powered by a capable MSAL
325328
(MSAL Python 1.12+ will be provisioned)
@@ -764,9 +767,9 @@ def initiate_auth_code_flow(
764767
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
765768
If included, it will skip the email-based discovery process that user goes
766769
through on the sign-in page, leading to a slightly more streamlined user experience.
767-
More information on possible values
768-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
769-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
770+
More information on possible values available in
771+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
772+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
770773
771774
:param int max_age:
772775
OPTIONAL. Maximum Authentication Age.
@@ -804,7 +807,7 @@ def initiate_auth_code_flow(
804807
"...": "...", // Everything else are reserved and internal
805808
}
806809
807-
The caller is expected to::
810+
The caller is expected to:
808811
809812
1. somehow store this content, typically inside the current session,
810813
2. guide the end user (i.e. resource owner) to visit that auth_uri,
@@ -868,9 +871,9 @@ def get_authorization_request_url(
868871
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
869872
If included, it will skip the email-based discovery process that user goes
870873
through on the sign-in page, leading to a slightly more streamlined user experience.
871-
More information on possible values
872-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
873-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
874+
More information on possible values available in
875+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
876+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
874877
:param claims_challenge:
875878
The claims_challenge parameter requests specific claims requested by the resource provider
876879
in the form of a claims_challenge directive in the www-authenticate header to be
@@ -1682,6 +1685,9 @@ class PublicClientApplication(ClientApplication): # browser app or mobile app
16821685
CONSOLE_WINDOW_HANDLE = object()
16831686

16841687
def __init__(self, client_id, client_credential=None, **kwargs):
1688+
"""Same as :func:`ClientApplication.__init__`,
1689+
except that ``client_credential`` parameter shall remain ``None``.
1690+
"""
16851691
if client_credential is not None:
16861692
raise ValueError("Public Client should not possess credentials")
16871693
super(PublicClientApplication, self).__init__(
@@ -1722,9 +1728,9 @@ def acquire_token_interactive(
17221728
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
17231729
If included, it will skip the email-based discovery process that user goes
17241730
through on the sign-in page, leading to a slightly more streamlined user experience.
1725-
More information on possible values
1726-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
1727-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
1731+
More information on possible values available in
1732+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
1733+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
17281734
17291735
:param claims_challenge:
17301736
The claims_challenge parameter requests specific claims requested by the resource provider
@@ -1994,6 +2000,9 @@ def acquire_token_by_device_flow(self, flow, claims_challenge=None, **kwargs):
19942000

19952001

19962002
class ConfidentialClientApplication(ClientApplication): # server-side web app
2003+
"""Same as :func:`ClientApplication.__init__`,
2004+
except that ``allow_broker`` parameter shall remain ``None``.
2005+
"""
19972006

19982007
def acquire_token_for_client(self, scopes, claims_challenge=None, **kwargs):
19992008
"""Acquires token for the current confidential client, not for an end user.

msal/token_cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def find(self, credential_type, target=None, query=None):
102102
]
103103

104104
def add(self, event, now=None):
105-
# type: (dict) -> None
106105
"""Handle a token obtaining event, and add tokens into cache."""
107106
def make_clean_copy(dictionary, sensitive_fields): # Masks sensitive info
108107
return {

0 commit comments

Comments
 (0)