Skip to content

Commit 09e9078

Browse files
authored
Merge pull request #669 from AzureAD/release-1.27
MSAL Python 1.27
2 parents 403a33d + 7e04519 commit 09e9078

27 files changed

+478
-137
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: '[Bug] '
5-
labels: ["untriaged", "needs attention"]
4+
title: "[Bug] "
5+
labels: needs attention, untriaged
66
assignees: ''
77

88
---
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature request
2+
description: Suggest a new feature for MSAL Python.
3+
labels: ["feature request", "untriaged", "needs attention"]
4+
title : '[Feature Request] '
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Before submitting your feature request
10+
Please make sure that your question or issue is not already covered in [MSAL documentation](https://learn.microsoft.com/entra/msal/python/) or [samples](https://learn.microsoft.com/azure/active-directory/develop/sample-v2-code?tabs=apptype).
11+
12+
- type: markdown
13+
attributes:
14+
value: |
15+
## Feature request for MSAL Python
16+
17+
- type: dropdown
18+
attributes:
19+
label: MSAL client type
20+
description: Are you using Public Client (desktop apps, CLI apps) or Confidential Client (web apps, web APIs, service-to-service, managed identity)?
21+
multiple: true
22+
options:
23+
- "Public"
24+
- "Confidential"
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
attributes:
30+
label: Problem Statement
31+
description: "Describe the problem or context for this feature request."
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
attributes:
37+
label: Proposed solution
38+
description: "Describe the solution you'd like."
39+
validations:
40+
required: false

.github/workflows/python-package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
# and then run benchmark only once (sampling with only one Python version).
5757
needs: ci
5858
runs-on: ubuntu-latest
59+
permissions:
60+
contents: write
5961
steps:
6062
- uses: actions/checkout@v4
6163
- name: Set up Python 3.9

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#
6363
# This is also used if you do content translation via gettext catalogs.
6464
# Usually you set "language" from the command line for these cases.
65-
language = None
65+
language = "en"
6666

6767
# List of patterns, relative to source directory, that match files and
6868
# directories to ignore when looking for source files.
@@ -95,7 +95,7 @@
9595
# Add any paths that contain custom static files (such as style sheets) here,
9696
# relative to this directory. They are copied after the builtin static files,
9797
# so a file named "default.css" will overwrite the builtin "default.css".
98-
html_static_path = ['_static']
98+
#html_static_path = ['_static']
9999

100100
# Custom sidebar templates, must be a dictionary that maps document names
101101
# to template names.

docs/index.rst

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
=========================
12
MSAL Python Documentation
23
=========================
34

@@ -6,11 +7,11 @@ MSAL Python Documentation
67
:caption: Contents:
78
:hidden:
89

9-
index
10-
1110
..
1211
Comment: Perhaps because of the theme, only the first level sections will show in TOC,
1312
regardless of maxdepth setting.
13+
UPDATE: And now (early 2024) suddenly a function-level, long TOC is generated,
14+
even though maxdepth is set to 2.
1415
1516
You can find high level conceptual documentations in the project
1617
`README <https://github.com/AzureAD/microsoft-authentication-library-for-python>`_.
@@ -23,7 +24,7 @@ MSAL Python supports some of them.
2324
**The following diagram serves as a map. Locate your application scenario on the map.**
2425
**If the corresponding icon is clickable, it will bring you to an MSAL Python sample for that scenario.**
2526

26-
* Most authentication scenarios acquire tokens on behalf of signed-in users.
27+
* Most authentication scenarios acquire tokens representing the signed-in user.
2728

2829
.. raw:: html
2930

@@ -43,7 +44,7 @@ MSAL Python supports some of them.
4344
alt="Browserless app" title="Browserless app" href="https://github.com/Azure-Samples/ms-identity-python-devicecodeflow">
4445
</map>
4546

46-
* There are also daemon apps. In these scenarios, applications acquire tokens on behalf of themselves with no user.
47+
* There are also daemon apps, who acquire tokens representing themselves, not a user.
4748

4849
.. raw:: html
4950

@@ -63,26 +64,24 @@ MSAL Python supports some of them.
6364

6465
API Reference
6566
=============
67+
.. note::
68+
69+
Only the contents inside
70+
`this source file <https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/dev/msal/__init__.py>`_
71+
and their documented methods (unless otherwise marked as deprecated)
72+
are MSAL Python public API,
73+
which are guaranteed to be backward-compatible until the next major version.
74+
75+
Everything else, regardless of their naming, are all internal helpers,
76+
which could change at anytime in the future, without prior notice.
6677

6778
The following section is the API Reference of MSAL Python.
68-
The API Reference is like a dictionary. You **read this API section when and only when**:
79+
The API Reference is like a dictionary, which is useful when:
6980

7081
* You already followed our sample(s) above and have your app up and running,
7182
but want to know more on how you could tweak the authentication experience
7283
by using other optional parameters (there are plenty of them!)
73-
* You read the MSAL Python source code and found a helper function that is useful to you,
74-
then you would want to double check whether that helper is documented below.
75-
Only documented APIs are considered part of the MSAL Python public API,
76-
which are guaranteed to be backward-compatible in MSAL Python 1.x series.
77-
Undocumented internal helpers are subject to change anytime, without prior notice.
78-
79-
.. note::
80-
81-
Only APIs and their parameters documented in this section are part of public API,
82-
with guaranteed backward compatibility for the entire 1.x series.
83-
84-
Other modules in the source code are all considered as internal helpers,
85-
which could change at anytime in the future, without prior notice.
84+
* Some important features have their in-depth documentations in the API Reference.
8685

8786
MSAL proposes a clean separation between
8887
`public client applications and confidential client applications
@@ -92,7 +91,7 @@ They are implemented as two separated classes,
9291
with different methods for different authentication scenarios.
9392

9493
ClientApplication
95-
=================
94+
-----------------
9695

9796
.. autoclass:: msal.ClientApplication
9897
:members:
@@ -101,22 +100,23 @@ ClientApplication
101100
.. automethod:: __init__
102101

103102
PublicClientApplication
104-
=======================
103+
-----------------------
105104

106105
.. autoclass:: msal.PublicClientApplication
107106
:members:
108107

108+
.. autoattribute:: msal.PublicClientApplication.CONSOLE_WINDOW_HANDLE
109109
.. automethod:: __init__
110110

111111
ConfidentialClientApplication
112-
=============================
112+
-----------------------------
113113

114114
.. autoclass:: msal.ConfidentialClientApplication
115115
:members:
116116

117117

118118
TokenCache
119-
==========
119+
----------
120120

121121
One of the parameters accepted by
122122
both `PublicClientApplication` and `ConfidentialClientApplication`
@@ -130,3 +130,41 @@ See `SerializableTokenCache` for example.
130130

131131
.. autoclass:: msal.SerializableTokenCache
132132
:members:
133+
134+
Prompt
135+
------
136+
.. autoclass:: msal.Prompt
137+
:members:
138+
139+
.. autoattribute:: msal.Prompt.SELECT_ACCOUNT
140+
.. autoattribute:: msal.Prompt.NONE
141+
.. autoattribute:: msal.Prompt.CONSENT
142+
.. autoattribute:: msal.Prompt.LOGIN
143+
144+
PopAuthScheme
145+
-------------
146+
147+
This is used as the `auth_scheme` parameter in many of the acquire token methods
148+
to support for Proof of Possession (PoP) tokens.
149+
150+
New in MSAL Python 1.26
151+
152+
.. autoclass:: msal.PopAuthScheme
153+
:members:
154+
155+
.. autoattribute:: msal.PopAuthScheme.HTTP_GET
156+
.. autoattribute:: msal.PopAuthScheme.HTTP_POST
157+
.. autoattribute:: msal.PopAuthScheme.HTTP_PUT
158+
.. autoattribute:: msal.PopAuthScheme.HTTP_DELETE
159+
.. autoattribute:: msal.PopAuthScheme.HTTP_PATCH
160+
.. automethod:: __init__
161+
162+
163+
Exceptions
164+
----------
165+
These are exceptions that MSAL Python may raise.
166+
You should not need to create them directly.
167+
You may want to catch them to provide a better error message to your end users.
168+
169+
.. autoclass:: msal.IdTokenError
170+

msal/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
ConfidentialClientApplication,
3232
PublicClientApplication,
3333
)
34-
from .oauth2cli.oidc import Prompt
34+
from .oauth2cli.oidc import Prompt, IdTokenError
3535
from .token_cache import TokenCache, SerializableTokenCache
3636
from .auth_scheme import PopAuthScheme
37-

0 commit comments

Comments
 (0)