Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case to show that OBO supports SP #481

Open
wants to merge 610 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
610 commits
Select commit Hold shift + click to select a range
b371055
Merge pull request #282 from AzureAD/acquire-token-interactive-bugfix
rayluo Dec 4, 2020
af1cebd
Merge remote-tracking branch 'oauth2cli/dev' into dev
rayluo Dec 4, 2020
1f7d503
A sample for the new acquire_token_interactive()
rayluo Dec 4, 2020
ea9d4ef
Merge pull request #283 from AzureAD/acquire-token-interactive-sample
rayluo Dec 5, 2020
0091a9f
MSAL Python 1.7.0
rayluo Dec 5, 2020
2cf06e1
Merge pull request #285 from AzureAD/release-1.7.0
rayluo Dec 7, 2020
41e27d9
Enables extra_scopes_to_consent in acquire_token_silent()
rayluo Dec 8, 2020
86c7ee8
Merge pull request #286 from AzureAD/extra-scopes-to-consent
rayluo Dec 8, 2020
38b68f4
Merge remote-tracking branch 'oauth2cli/dev' into acquire-token-inter…
rayluo Dec 14, 2020
2a54a8d
Merge pull request #288 from AzureAD/acquire-token-interactive
rayluo Dec 15, 2020
9ca339a
MSAL 1.8.0
rayluo Dec 15, 2020
add2ccf
Merge pull request #291 from AzureAD/release-1.8.0
rayluo Dec 16, 2020
4715cc9
Merge remote-tracking branch 'oauth2cli/dev' into compatible-with-pyj…
rayluo Jan 15, 2021
736cd76
Merge pull request #296 from AzureAD/compatible-with-pyjwt1_and_2
rayluo Jan 19, 2021
0c9303d
The ssh-cert scope needs to be updated
rayluo Jan 20, 2021
2b7a524
Merge branch 'update-ssh-cert-test-case' into dev
rayluo Jan 21, 2021
de51404
Show correlation_id when unittesting with -v param
rayluo Jan 25, 2021
56a6c27
Refactor SSH Cert test cases to represent test requirements, and offi…
rayluo Jan 28, 2021
dbf30c2
Merge pull request #300 from AzureAD/ssh-cert-tests
rayluo Jan 29, 2021
36c46bd
Precise DeprecationWarning for auth code API
rayluo Jan 30, 2021
08c7a06
Merge pull request #303 from AzureAD/deprecates-auth-code
rayluo Feb 2, 2021
615f632
Trying github actions
rayluo Jan 30, 2021
7663cf0
Disable flake8 for now
rayluo Jan 30, 2021
edd6138
Fake a TRAVIS env
rayluo Jan 30, 2021
274cc00
Use env vars to enable e2e tests
rayluo Feb 2, 2021
d892384
Cache dependencies, although the gain is insignificant for this repo
rayluo Feb 3, 2021
61b4a28
Enable tests on all python versions we supported
rayluo Feb 3, 2021
dd5ebaa
Merge branch 'github-actions' into dev
rayluo Feb 3, 2021
bdda6cb
Refine OBO test case's guidance message
rayluo Feb 3, 2021
93fca66
Merge pull request #305 from AzureAD/obo-test-message
rayluo Feb 3, 2021
3b10466
Add prompt parameter into interactive sample
rayluo Feb 3, 2021
58ad48c
Merge pull request #306 from AzureAD/interactive-sample-prompt
rayluo Feb 3, 2021
e56cdd3
Pass kwargs to acquire_token_by_refresh_token (#298)
jiasli Feb 3, 2021
9340c2f
Merge remote-tracking branch 'oauth2cli/dev' into improve-aud-error-msg
rayluo Feb 4, 2021
a019b3e
Merge pull request #307 from AzureAD/improve-aud-error-msg
rayluo Feb 4, 2021
49ff637
Merge remote-tracking branch 'oauth2cli/dev' into interactive-flow-ad…
rayluo Feb 7, 2021
026cf33
Merge branch 'interactive-flow-adjustment' into dev
rayluo Feb 7, 2021
146e7b5
MSAL Python 1.9.0
rayluo Feb 9, 2021
3815326
We will use github actions for release
rayluo Feb 9, 2021
27ab95b
Merge pull request #310 from AzureAD/release-1.9.0
rayluo Feb 9, 2021
9591106
Let e2e test use PCA or CCA rather than base class
rayluo Feb 14, 2021
8b2297d
Merge branch 'e2e-uses-pca-cca-rather-than-base-class' into dev
rayluo Feb 14, 2021
7eb55a5
Implement refresh_in behavior, and some test cases
rayluo Feb 12, 2021
c184dce
Documents Redirect URI requirement for interactive flow
rayluo Feb 20, 2021
af2d8fe
Merge pull request #313 from AzureAD/documents-redirect-uri-requireme…
rayluo Feb 20, 2021
57ad1a3
Merge pull request #312 from AzureAD/refresh-in
rayluo Feb 23, 2021
38f512a
More suitable for work :-)
rayluo Mar 3, 2021
184de89
Keep unfit RTs b/c they might be useful for others
rayluo Mar 2, 2021
8e0639c
Decide to completely disable RT removal
rayluo Mar 2, 2021
0f88d1b
Merge pull request #315 from AzureAD/keep-rt-for-others
rayluo Mar 3, 2021
0c98bab
Only trigger CI/CD when a PR is labelled
rayluo Mar 3, 2021
8158ac5
Merge pull request #318 from AzureAD/cicd-with-label-only
rayluo Mar 3, 2021
5ce3f0a
Merge pull request #317 from AzureAD/no-more-rtfd
rayluo Mar 4, 2021
88479e8
Refactor docs into a different theme, improve nav (#319)
tonybaloney Mar 4, 2021
d45ccd6
Filter out refresh_in from auth responses
rayluo Mar 4, 2021
96890a4
Merge pull request #320 from AzureAD/refresh-in
rayluo Mar 4, 2021
ce63016
Bumping version number
rayluo Mar 8, 2021
27df242
Merge pull request #322 from AzureAD/release-1.10.0
rayluo Mar 8, 2021
679d706
Fix typo in docstring
jiasli Mar 9, 2021
8f109ec
Merge pull request #323 from jiasli/scopes
rayluo Mar 10, 2021
f7514f3
Remove inaccurate doc due to copy-and-paste error
rayluo Mar 17, 2021
e735263
Merge pull request #327 from AzureAD/fix-doc-copy-paste-error
rayluo Mar 17, 2021
61e0deb
Enable retry on connection error
rayluo Mar 16, 2021
dd4638c
Merge pull request #326 from AzureAD/retry-connection-error
rayluo Mar 18, 2021
2e68856
Implementing Telemetry V4
rayluo Feb 24, 2021
7ff36cf
Merge pull request #329 from AzureAD/telemetry-v4
rayluo Mar 29, 2021
4047c1b
Support launching browser in WSL Ubuntu 18.04 (#333)
jiasli Mar 30, 2021
4c0e582
Saml token should use utf-8 encoding
rayluo Mar 25, 2021
987a4b6
Merge pull request #336 from AzureAD/saml-utf8
rayluo Mar 31, 2021
5a60811
Fix type hint for `client_credential`
jiasli Apr 1, 2021
b59e2ba
Merge pull request #337 from jiasli/type-hint
rayluo Apr 1, 2021
060c5f5
survey added to README.md
ShannonCanTech Apr 6, 2021
00e11d7
Merge pull request #340 from ShannonCanTech/loyalty-survey-readme
rayluo Apr 7, 2021
2832281
Move ROPC from PCA to base
rayluo Mar 13, 2021
db30498
Merge pull request #344 from AzureAD/confidential-ropc
rayluo Apr 8, 2021
45e77c1
Fix typo
rayluo Apr 8, 2021
fb00713
Merge pull request #345 from AzureAD/telemetry-v4
rayluo Apr 8, 2021
c40256f
Bumps version number
rayluo Apr 8, 2021
0004be6
Doc for the new retry-on-connection-error behavior
rayluo Apr 8, 2021
8a196de
Merge branch 'retry-connection-error' into dev
rayluo Apr 8, 2021
073f8dd
Merge branch 'dev' into release-1.11.0
rayluo Apr 8, 2021
4585d05
Merge pull request #348 from AzureAD/release-1.11.0
rayluo Apr 9, 2021
1222486
Merge remote-tracking branch 'oauth2cli/dev' into sync-oauth2cli
rayluo Apr 13, 2021
be4d87e
Merge branch 'sync-oauth2cli' into dev
rayluo Apr 13, 2021
59ce0c4
Clarify supported Python versions
lmazuel Apr 13, 2021
4c1a644
Merge pull request #350 from lmazuel/patch-1
rayluo Apr 14, 2021
fbbc814
Group accounts by home_account_id, and keep same return format
rayluo Jun 4, 2020
1e3c99a
Merge pull request #349 from AzureAD/return-grouped-accounts
rayluo Apr 16, 2021
0b3b8a8
Adjust log to facilitate testing
rayluo Apr 19, 2021
c416542
Fix imprecise test
rayluo Apr 20, 2021
2168ed9
Merge branch 'improve-tests' into dev
rayluo Apr 21, 2021
a0c4120
Bring back docs for __init__()
rayluo Apr 24, 2021
5c539e1
Merge pull request #352 from AzureAD/docs-staging
rayluo Apr 24, 2021
a82e823
Use image map to guide customer to proper sample
rayluo Apr 23, 2021
94f173f
acquire_token_for_client() can use regional endpoint
rayluo Apr 23, 2021
36208a7
Expensive IMDS call
rayluo May 1, 2021
e9d27f2
Only call IMDS when input region != None
rayluo May 6, 2021
1129d19
Host diagrams locally
rayluo May 6, 2021
2c993dd
Grey out those scenarios MSAL does not yet support
rayluo May 6, 2021
a202633
Merge pull request #354 from AzureAD/docs-staging
rayluo May 7, 2021
de9bcf5
Add a thumbnail to real map
rayluo May 7, 2021
bf1c27c
Merge pull request #359 from AzureAD/add-map-thumbnail-into-readme
rayluo May 7, 2021
627daa9
An explicit short timeout is needed because the test case is run outs…
rayluo May 10, 2021
4a143b6
Assert regional request reaches regional endpoint
rayluo May 10, 2021
3ed3ce0
Tolerate authority validation error if opting in a region
rayluo May 10, 2021
dcdeb5a
Addresses https://github.com/AzureAD/microsoft-authentication-library…
rayluo May 10, 2021
f4292d8
Addresses https://github.com/AzureAD/microsoft-authentication-library…
rayluo May 10, 2021
474cae1
Rename region to azure_region based on https://github.com/AzureAD/mic…
rayluo May 10, 2021
211f5e4
Addresses https://github.com/AzureAD/microsoft-authentication-library…
rayluo May 11, 2021
b4fce33
Addresses https://github.com/AzureAD/microsoft-authentication-library…
rayluo May 11, 2021
7d16f5b
Addresses https://github.com/AzureAD/microsoft-authentication-library…
rayluo May 11, 2021
b57cd72
A demo on how to use prompt=create
rayluo May 11, 2021
a6ce8a3
Merge remote-tracking branch 'oauth2cli/dev' into prompt-create
rayluo May 14, 2021
e3cb43e
Use the newly introduced prompt constants
rayluo May 14, 2021
856c149
Merge pull request #360 from AzureAD/prompt-create
rayluo May 14, 2021
87a345f
Change ATTEMPT_REGION_DISCOVERY to boolean, to facilitate the runtime…
rayluo May 11, 2021
e0662f5
Merge pull request #358 from AzureAD/reginal-endpoint-experiment
rayluo May 18, 2021
2e23186
Proof-of-Concept: Removing hardcoded offline_access
rayluo Jun 17, 2020
f73e616
Remove hardcoded profile scope
rayluo Jun 24, 2020
f59ed82
Add exclude_scopes:Optional[list]
rayluo May 13, 2021
a51e7ed
Merge pull request #361 from AzureAD/remove-offline-access
rayluo May 18, 2021
de2284d
Fix NameError in ClientApplication exception handler
chlowell May 19, 2021
414e0ce
Also redact id token from now on
rayluo May 19, 2021
7c46467
Merge pull request #364 from AzureAD/redact-id-token-from-debug-log
rayluo May 19, 2021
82e8ec3
Merge pull request #363 from chlowell/patch-2
rayluo May 19, 2021
e9168d4
MSAL Python 1.12.0
rayluo May 19, 2021
b99f77c
Merge pull request #367 from AzureAD/release-1.12.0
rayluo May 19, 2021
81381b9
Should have not overreacted to account-not-found
rayluo May 26, 2021
34bd0e6
Merge branch 'downgrade-a-warning-message' into dev
rayluo May 26, 2021
a433b71
Add download stats for recent MSAL versions
rayluo Jun 4, 2021
9082dc1
Add support for acquiring a token with a pre-signed JWT (#271)
lochiiconnectivity Jun 7, 2021
448623c
Skip unnecessary and repetitive region detection
rayluo Jun 21, 2021
eea5151
Merge pull request #373 from AzureAD/regional-endpoint-optimization
rayluo Jun 24, 2021
9063359
MSAL Python 1.13.0
rayluo Jul 20, 2021
4db6ffa
Merge pull request #384 from AzureAD/release-1.13.0
rayluo Jul 20, 2021
3b371e1
Use dot-env for convenient local testing
rayluo Jul 15, 2021
7890783
Merge branch 'dot-env' into dev
rayluo Jul 23, 2021
dad2d5c
It was skipped and recently broken. Now it works.
rayluo Jul 30, 2021
c5e01c6
Merge branch 'worldwide-confidential-client-test' into dev
rayluo Jul 30, 2021
26252ce
Switch to github action badge
rayluo Jul 8, 2021
822661d
Merge branch 'switch-to-github-action-badge' into dev
rayluo Aug 1, 2021
6047d7d
Survive issue 387
rayluo Aug 4, 2021
aae2a87
Merge pull request #390 from AzureAD/fix-issue-387
rayluo Aug 4, 2021
8aa5d86
Merge in staged oauth2cli changes
rayluo Aug 5, 2021
807587e
Merge branch 'o2c' into dev
rayluo Aug 5, 2021
5ff2204
Merge remote-tracking branch 'oauth2cli_github/dev' into o2c
rayluo Aug 5, 2021
1457de4
Change regional endpoint doname name
rayluo Aug 10, 2021
e4adfef
Regional endpoint test cases do not rely on env var REGION_NAME
rayluo Aug 10, 2021
6d81ff1
REGION_NAME has no unified format across services
rayluo Aug 10, 2021
e9bd97f
Merge pull request #394 from AzureAD/region-endpoint-specs-changes
rayluo Aug 10, 2021
711f3cd
Prefer Edge when running on Linux
rayluo Jul 30, 2021
32a7ff3
Merge pull request #388 from AzureAD/prefer-edge-on-linux
rayluo Aug 19, 2021
1b386cb
An individual cache, after 3+ prototypes
rayluo May 7, 2020
b3098e8
ThrottledHttpClient
rayluo Jul 8, 2021
e538b02
Use throttled_http_client
rayluo Jul 8, 2021
649d515
Merge pull request #379 from AzureAD/http-cache
rayluo Aug 19, 2021
c8f3758
Convert staticmethod to module-wide public method
rayluo Aug 18, 2021
761073e
Merge branch 'refactor-token-cache-test-cases' into dev
rayluo Aug 19, 2021
7054e4e
Enable ThrottledHttpClient.close()
rayluo Aug 26, 2021
1849649
Merge branch 'http-cache' into dev
rayluo Aug 26, 2021
0dd87e4
MSAL Python 1.14
rayluo Aug 25, 2021
50de502
Merge pull request #401 from AzureAD/release-1.14.0
rayluo Aug 26, 2021
2483463
Implementing CCS Routing info
rayluo Aug 4, 2021
610da9c
Merge pull request #395 from AzureAD/ccs-routing-info
rayluo Sep 9, 2021
5041c77
Merge remote-tracking branch 'oauth2cli/dev' into ctrlc
rayluo Sep 9, 2021
0ffcd07
Merge pull request #404 from AzureAD/ctrlc
rayluo Sep 9, 2021
0c40195
Fix typos
jiasli Sep 1, 2021
d08d2da
Merge branch 'typo' into dev
rayluo Sep 10, 2021
24f1219
Merge remote-tracking branch 'oauth2cli/dev' into ctrlc
rayluo Sep 10, 2021
1bdf93b
Merge remote-tracking branch 'oauth2cli/dev' into max_age-and-validation
rayluo Sep 15, 2021
1c05a4d
Add max_age support https://stackoverflow.microsoft.com/questions/267…
rayluo Aug 3, 2021
bd6aa0d
Merge pull request #389 from AzureAD/max_age
rayluo Sep 15, 2021
a015d55
Map login_hint into CCS routing info, for now
rayluo Sep 29, 2021
788d3c8
Merge pull request #409 from AzureAD/ccs-routing
rayluo Sep 29, 2021
250c6d7
Bypass device authorization flow, for real
rayluo Sep 30, 2021
17126bb
Merge pull request #410 from AzureAD/http-cache
rayluo Sep 30, 2021
0d1417a
MSAL Python 1.15.0
rayluo Sep 30, 2021
9658d19
Bumping cryptography upper bound to X+3
rayluo Sep 30, 2021
fa615bf
Merge pull request #414 from AzureAD/bumping-cryptography-upper-bound
rayluo Oct 1, 2021
03d690d
Merge branch 'bumping-cryptography-upper-bound' into release-1.15.0
rayluo Oct 1, 2021
eecf1c1
Merge branch 'release-1.15.0' into dev
rayluo Oct 1, 2021
544e3e5
Expose http_cache parameter, with its docs and recipe.
rayluo Jul 8, 2021
78858f1
Merge pull request #407 from AzureAD/http-cache-parameter
rayluo Oct 15, 2021
fc5ff49
Merge remote-tracking branch 'oauth2cli_github/dev' into auth-code-re…
rayluo Oct 16, 2021
d8855eb
Merge remote-tracking branch 'oauth2cli/dev' into auth-code-receiver
rayluo Oct 21, 2021
ab72e9c
Merge remote-tracking branch 'oauth2cli/dev' into auth-code-receiver
rayluo Oct 27, 2021
2f1b48b
Adjusts the path
rayluo Oct 27, 2021
0c50d23
Merge pull request #427 from AzureAD/auth-code-receiver
rayluo Oct 28, 2021
2cbc14e
tests/authcode.py has long been obsolete
rayluo Oct 27, 2021
c2ffe94
Merge branch 'clean-up' into dev
rayluo Oct 28, 2021
7d1b03f
Re-enable REGION env var detection
rayluo Oct 6, 2021
f80b5c1
Change Regional Endpoint to require opt-in
rayluo Oct 22, 2021
be5f8f0
Merge pull request #425 from AzureAD/region-env-var
rayluo Oct 28, 2021
091a07d
MSAL Python 1.16.0
rayluo Oct 29, 2021
6ccc507
Merge pull request #430 from AzureAD/release-1.16.0
rayluo Oct 29, 2021
a81c355
Bubble up refresh exception when we cannot recover
rayluo Nov 2, 2021
425a908
Merge pull request #434 from AzureAD/bubble-up-refresh-exception
rayluo Nov 3, 2021
5271e1f
Lazy initialization makes partial test faster
rayluo Nov 5, 2021
3fa48d6
Merge branch 'refactor-test-application' into dev
rayluo Nov 5, 2021
7e2172a
Add cloud instances string constants
rayluo Nov 2, 2021
7ba324b
Merge pull request #433 from AzureAD/cloud-instances
rayluo Nov 9, 2021
8659b27
Fine tune http_cache usage pattern
rayluo Nov 10, 2021
515fbd2
Merge pull request #439 from AzureAD/http-cache-pattern
rayluo Nov 17, 2021
aee20e3
Descriptive error messages for troubleshooting
rayluo Nov 25, 2021
38563e0
Merge pull request #443 from AzureAD/authority-error-messages
rayluo Dec 1, 2021
88575d2
Document redirect_uri requirement inside sample
rayluo Dec 11, 2021
e7eee38
Merge remote-tracking branch 'oauth2cli/dev' into time-suggestion
rayluo Dec 28, 2021
4ca342d
Merge pull request #449 from AzureAD/time-suggestion
rayluo Dec 28, 2021
43c6280
Merge remote-tracking branch 'oauth2cli/dev' into time-suggestion
rayluo Jan 19, 2022
3879b90
Merge pull request #453 from AzureAD/time-suggestion
rayluo Jan 19, 2022
149360b
Lazy load dependencies
rayluo Jan 19, 2022
8e081d4
Merge pull request #454 from AzureAD/lazy-load
rayluo Jan 24, 2022
6264fd8
Document new info on how to detect edge on Linux
rayluo Jan 25, 2022
eb7c58b
Remove decommissioned domain to get tests working
rayluo Feb 2, 2022
9d48d29
Merge branch 'blackforest-decommission' into dev
rayluo Feb 2, 2022
31c7498
Change skip() to skipTest()
rayluo Feb 3, 2022
034b9ae
Actionable exception from ADFS ROPC
rayluo Feb 8, 2022
d2f0f14
Merge pull request #456 from AzureAD/actionable-runtime-error-for-adfs
rayluo Feb 9, 2022
e0b8a88
Removes the middle-layer exception
rayluo Feb 10, 2022
c0edde2
Merge pull request #458 from AzureAD/actionable-runtime-error-for-adfs
rayluo Feb 11, 2022
844c0ed
MSAL Python 1.17.0
rayluo Feb 8, 2022
f197234
Merge pull request #461 from AzureAD/release-1.17.0
rayluo Feb 11, 2022
997517a
Use absolute link for thumbnail in README
rayluo Feb 11, 2022
1e51ee3
Test matrix covers Python 3.10
rayluo Feb 9, 2022
42672d5
Test matrix covers Python 3.11
rayluo Feb 9, 2022
c7be0d8
Merge pull request #462 from AzureAD/more-py3-versions
rayluo Feb 14, 2022
cec910a
Fine tune some inline comments
rayluo Feb 14, 2022
599142f
Add an interactive console test script
rayluo Apr 19, 2022
2ae2d2c
Fine tune msaltest.py with prompt options
rayluo May 3, 2022
7d7a492
implement response_mode (#469)
eopeter May 12, 2022
0ef4a48
Automatically populate login_hint for easier tests
rayluo May 14, 2022
724746f
Merge branch 'msaltest' into dev
rayluo May 14, 2022
56d80c4
Emit warning when common or organizations is used in acquire_token_fo…
rayluo Nov 5, 2021
ead7d53
Merge pull request #435 from AzureAD/warning-in-acquire-token-for-client
rayluo May 17, 2022
669ac85
Acquire SSH cert from Cloud Shell IMDS
rayluo Oct 18, 2021
c644e57
MSAL Python 1.18.0b1
rayluo May 19, 2022
366e758
Fix typo in code
OvervCW May 30, 2022
a61ca7e
Merge pull request #420 from AzureAD/cloudshell-imds
rayluo May 31, 2022
dd79e93
Merge pull request #475 from AzureAD/release-1.18.0b1
rayluo May 31, 2022
8cb7f8b
MSAL Python 1.18.0
rayluo May 31, 2022
2e36358
Merge pull request #478 from AzureAD/release-1.18.0
rayluo May 31, 2022
a92a15b
Document our findings on addressing CVE-2022-29217
rayluo May 31, 2022
589c0be
Merge pull request #479 from AzureAD/pyjwt
rayluo May 31, 2022
bbd75fd
Disable test for China cloud
rayluo May 31, 2022
89b9da9
Merge branch 'disable-test-for-chinacloud' into dev
rayluo May 31, 2022
7f5bf64
Merge pull request #474 from OvervCW/patch-1
rayluo Jun 3, 2022
b74c08f
Merge remote-tracking branch 'oauth2cli/dev' into oauth2cli-dev
rayluo Jun 3, 2022
a995c05
Merge branch 'oauth2cli-dev' into dev
rayluo Jun 3, 2022
85f4f9e
Tolerate home_account_id to be None
rayluo Jun 8, 2022
642ea65
Add test case to show that OBO supports SP
rayluo Apr 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to our [off-the-shelf samples](https://github.com/AzureAD/microsoft-authentication-library-for-python/tree/dev/sample) and pick one that is closest to your usage scenario. You should not need to modify the sample.
2. Follow the description of the sample, typically at the beginning of it, to prepare a `config.json` containing your test configurations
3. Run such sample, typically by `python sample.py config.json`
4. See the error
5. In this bug report, tell us the sample you choose, paste the content of the config.json with your test setup (which you can choose to skip your credentials, and/or mail it to our developer's email).

**Expected behavior**
A clear and concise description of what you expected to happen.

**What you see instead**
Paste the sample output, or add screenshots to help explain your problem.

**The MSAL Python version you are using**
Paste the output of this
`python -c "import msal; print(msal.__version__)"`

**Additional context**
Add any other context about the problem here.
92 changes: 92 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI/CD

on:
push:
pull_request:
branches: [ dev ]

# This guards against unknown PR until a community member vet it and label it.
types: [ labeled ]

jobs:
ci:
env:
# Fake a TRAVIS env so that the pre-existing test cases would behave like before
TRAVIS: true
LAB_APP_CLIENT_ID: ${{ secrets.LAB_APP_CLIENT_ID }}
LAB_APP_CLIENT_SECRET: ${{ secrets.LAB_APP_CLIENT_SECRET }}
LAB_OBO_CLIENT_SECRET: ${{ secrets.LAB_OBO_CLIENT_SECRET }}
LAB_OBO_CONFIDENTIAL_CLIENT_ID: ${{ secrets.LAB_OBO_CONFIDENTIAL_CLIENT_ID }}
LAB_OBO_PUBLIC_CLIENT_ID: ${{ secrets.LAB_OBO_PUBLIC_CLIENT_ID }}

# Derived from https://docs.github.com/en/actions/guides/building-and-testing-python#starting-with-the-python-workflow-template
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11.0-alpha.5"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# Derived from https://github.com/actions/cache/blob/main/examples.md#using-pip-to-get-cache-location
# However, a before-and-after test shows no improvement in this repo,
# possibly because the bottlenect was not in downloading those small python deps.
- name: Get pip cache dir from pip 20.1+
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest

cd:
needs: ci
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build a package for release
run: |
python -m pip install build --user
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
if: github.ref == 'refs/heads/main'
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ src/build

# Virtual Environments
/env*

.venv/
docs/_build/
# Visual Studio Files
/.vs/*
/tests/.vs/*
Expand All @@ -56,3 +57,5 @@ src/build
# The test configuration file(s) could potentially contain credentials
tests/config.json


.env
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,43 @@ python:
- "2.7"
- "3.5"
- "3.6"
# Borrowed from https://github.com/travis-ci/travis-ci/issues/9815
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
- python: 3.8
dist: xenial
sudo: true

install:
- pip install -r requirements.txt
script:
- python -m unittest discover -s tests

deploy:
- # test pypi
provider: pypi
distributions: "sdist bdist_wheel"
server: https://test.pypi.org/legacy/
user: "nugetaad"
password:
secure: KkjKySJujYxx31B15mlAZr2Jo4P99LcrMj3uON/X/WMXAqYVcVsYJ6JSzUvpNnCAgk+1hc24Qp6nibQHV824yiK+eG4qV+lpzkEEedkRx6NOW/h09OkT+pOSVMs0kcIhz7FzqChpl+jf6ZZpb13yJpQg2LoZIA4g8UdYHHFidWt4m5u1FZ9LPCqQ0OT3gnKK4qb0HIDaECfz5GYzrelLLces0PPwj1+X5eb38xUVtbkA1UJKLGKI882D8Rq5eBdbnDGsfDnF6oU+EBnGZ7o6HVQLdBgagDoVdx7yoXyntULeNxTENMTOZJEJbncQwxRgeEqJWXTTEW57O6Jo5uiHEpJA9lAePlRbS+z6BPDlnQogqOdTsYS0XMfOpYE0/r3cbtPUjETOmGYQxjQzfrFBfM7jaWnUquymZRYqCQ66VDo3I/ykNOCoM9qTmWt5L/MFfOZyoxLHnDThZBdJ3GXHfbivg+v+vOfY1gG8e2H2lQY+/LIMIJibF+MS4lJgrB81dcNdBzyxMNByuWQjSL1TY7un0QzcRcZz2NLrFGg8+9d67LQq4mK5ySimc6zdgnanuROU02vGr1EApT6D/qUItiulFgWqInNKrFXE9q74UP/WSooZPoLa3Du8y5s4eKerYYHQy5eSfIC8xKKDU8MSgoZhwQhCUP46G9Nsty0PYQc=
on:
branch: master
tags: false
condition: $TRAVIS_PYTHON_VERSION = "2.7"

- # production pypi
provider: pypi
distributions: "sdist bdist_wheel"
user: "nugetaad"
password:
secure: KkjKySJujYxx31B15mlAZr2Jo4P99LcrMj3uON/X/WMXAqYVcVsYJ6JSzUvpNnCAgk+1hc24Qp6nibQHV824yiK+eG4qV+lpzkEEedkRx6NOW/h09OkT+pOSVMs0kcIhz7FzqChpl+jf6ZZpb13yJpQg2LoZIA4g8UdYHHFidWt4m5u1FZ9LPCqQ0OT3gnKK4qb0HIDaECfz5GYzrelLLces0PPwj1+X5eb38xUVtbkA1UJKLGKI882D8Rq5eBdbnDGsfDnF6oU+EBnGZ7o6HVQLdBgagDoVdx7yoXyntULeNxTENMTOZJEJbncQwxRgeEqJWXTTEW57O6Jo5uiHEpJA9lAePlRbS+z6BPDlnQogqOdTsYS0XMfOpYE0/r3cbtPUjETOmGYQxjQzfrFBfM7jaWnUquymZRYqCQ66VDo3I/ykNOCoM9qTmWt5L/MFfOZyoxLHnDThZBdJ3GXHfbivg+v+vOfY1gG8e2H2lQY+/LIMIJibF+MS4lJgrB81dcNdBzyxMNByuWQjSL1TY7un0QzcRcZz2NLrFGg8+9d67LQq4mK5ySimc6zdgnanuROU02vGr1EApT6D/qUItiulFgWqInNKrFXE9q74UP/WSooZPoLa3Du8y5s4eKerYYHQy5eSfIC8xKKDU8MSgoZhwQhCUP46G9Nsty0PYQc=
on:
branch: master
tags: true
condition: $TRAVIS_PYTHON_VERSION = "2.7"

24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The MIT License (MIT)

Copyright (c) Microsoft Corporation.
All rights reserved.

This code is licensed under the MIT License.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
147 changes: 147 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Microsoft Authentication Library (MSAL) for Python

| `dev` branch | Reference Docs | # of Downloads per different platforms | # of Downloads per recent MSAL versions |
|---------------|---------------|----------------------------------------|-----------------------------------------|
[![Build status](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions/workflows/python-package.yml/badge.svg?branch=dev)](https://github.com/AzureAD/microsoft-authentication-library-for-python/actions) | [![Documentation Status](https://readthedocs.org/projects/msal-python/badge/?version=latest)](https://msal-python.readthedocs.io/en/latest/?badge=latest) | [![Downloads](https://pepy.tech/badge/msal)](https://pypistats.org/packages/msal) | [![Download monthly](https://pepy.tech/badge/msal/month)](https://pepy.tech/project/msal)

The Microsoft Authentication Library for Python enables applications to integrate with the [Microsoft identity platform](https://aka.ms/aaddevv2). It allows you to sign in users or apps with Microsoft identities ([Azure AD](https://azure.microsoft.com/services/active-directory/), [Microsoft Accounts](https://account.microsoft.com) and [Azure AD B2C](https://azure.microsoft.com/services/active-directory-b2c/) accounts) and obtain tokens to call Microsoft APIs such as [Microsoft Graph](https://graph.microsoft.io/) or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols

Not sure whether this is the SDK you are looking for your app? There are other Microsoft Identity SDKs
[here](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Microsoft-Authentication-Client-Libraries).

Quick links:

| [Getting Started](https://docs.microsoft.com/azure/active-directory/develop/quickstart-v2-python-webapp) | [Docs](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki) | [Samples](https://aka.ms/aaddevsamplesv2) | [Support](README.md#community-help-and-support) | [Feedback](https://forms.office.com/r/TMjZkDbzjY) |
| --- | --- | --- | --- | --- |

## Scenarios supported

Click on the following thumbnail to visit a large map with clickable links to proper samples.

[![Map effect won't work inside github's markdown file, so we have to use a thumbnail here to lure audience to a real static website](https://raw.githubusercontent.com/AzureAD/microsoft-authentication-library-for-python/dev/docs/thumbnail.png)](https://msal-python.readthedocs.io/en/latest/)

## Installation

You can find MSAL Python on [Pypi](https://pypi.org/project/msal/).
1. If you haven't already, [install and/or upgrade the pip](https://pip.pypa.io/en/stable/installing/)
of your Python environment to a recent version. We tested with pip 18.1.
2. As usual, just run `pip install msal`.

## Versions

This library follows [Semantic Versioning](http://semver.org/).

You can find the changes for each version under
[Releases](https://github.com/AzureAD/microsoft-authentication-library-for-python/releases).

## Usage

Before using MSAL Python (or any MSAL SDKs, for that matter), you will have to
[register your application with the Microsoft identity platform](https://docs.microsoft.com/azure/active-directory/develop/quickstart-v2-register-an-app).

Acquiring tokens with MSAL Python follows this 3-step pattern.
(Note: That is the high level conceptual pattern.
There will be some variations for different flows. They are demonstrated in
[runnable samples hosted right in this repo](https://github.com/AzureAD/microsoft-authentication-library-for-python/tree/dev/sample).
)


1. MSAL proposes a clean separation between
[public client applications, and confidential client applications](https://tools.ietf.org/html/rfc6749#section-2.1).
So you will first create either a `PublicClientApplication` or a `ConfidentialClientApplication` instance,
and ideally reuse it during the lifecycle of your app. The following example shows a `PublicClientApplication`:

```python
from msal import PublicClientApplication
app = PublicClientApplication(
"your_client_id",
authority="https://login.microsoftonline.com/Enter_the_Tenant_Name_Here")
```

Later, each time you would want an access token, you start by:
```python
result = None # It is just an initial value. Please follow instructions below.
```

2. The API model in MSAL provides you explicit control on how to utilize token cache.
This cache part is technically optional, but we highly recommend you to harness the power of MSAL cache.
It will automatically handle the token refresh for you.

```python
# We now check the cache to see
# whether we already have some accounts that the end user already used to sign in before.
accounts = app.get_accounts()
if accounts:
# If so, you could then somehow display these accounts and let end user choose
print("Pick the account you want to use to proceed:")
for a in accounts:
print(a["username"])
# Assuming the end user chose this one
chosen = accounts[0]
# Now let's try to find a token in cache for this account
result = app.acquire_token_silent(["your_scope"], account=chosen)
```

3. Either there is no suitable token in the cache, or you chose to skip the previous step,
now it is time to actually send a request to AAD to obtain a token.
There are different methods based on your client type and scenario. Here we demonstrate a placeholder flow.

```python
if not result:
# So no suitable token exists in cache. Let's get a new one from AAD.
result = app.acquire_token_by_one_of_the_actual_method(..., scopes=["User.Read"])
if "access_token" in result:
print(result["access_token"]) # Yay!
else:
print(result.get("error"))
print(result.get("error_description"))
print(result.get("correlation_id")) # You may need this when reporting a bug
```

Refer the [Wiki](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki) pages for more details on the MSAL Python functionality and usage.

## Migrating from ADAL

If your application is using ADAL Python, we recommend you to update to use MSAL Python. No new feature work will be done in ADAL Python.

See the [ADAL to MSAL migration](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Migrate-to-MSAL-Python) guide.

## Roadmap

You can follow the latest updates and plans for MSAL Python in the [Roadmap](https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Roadmap) published on our Wiki.

## Samples and Documentation

MSAL Python supports multiple [application types and authentication scenarios](https://docs.microsoft.com/azure/active-directory/develop/authentication-flows-app-scenarios).
The generic documents on
[Auth Scenarios](https://docs.microsoft.com/azure/active-directory/develop/authentication-scenarios)
and
[Auth protocols](https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols)
are recommended reading.

We provide a [full suite of sample applications](https://aka.ms/aaddevsamplesv2) and [documentation](https://aka.ms/aaddevv2) to help you get started with learning the Microsoft identity platform.

## Community Help and Support

We leverage Stack Overflow to work with the community on supporting Azure Active Directory and its SDKs, including this one!
We highly recommend you ask your questions on Stack Overflow (we're all on there!)
Also browser existing issues to see if someone has had your question before.

We recommend you use the "msal" tag so we can see it!
Here is the latest Q&A on Stack Overflow for MSAL:
[http://stackoverflow.com/questions/tagged/msal](http://stackoverflow.com/questions/tagged/msal)

## Submit Feedback
We'd like your thoughts on this library. Please complete [this short survey.](https://forms.office.com/r/TMjZkDbzjY)

## Security Reporting

If you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/security/dd252948) and subscribing to Security Advisory Alerts.

## Contributing

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.

## We Value and Adhere to the Microsoft Open Source Code of Conduct

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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
Loading
Loading