-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pop token support * Update sdk/identity/azure-identity-broker/CHANGELOG.md Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com> * rename sample * update changelog * Update sdk/identity/azure-identity-broker/CHANGELOG.md Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com> * unblock this PR. fix incoming in 37450 * Update version Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com> --------- Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com> Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com> Co-authored-by: Scott Beddall <scbedd@microsoft.com>
- Loading branch information
1 parent
22c2d80
commit b551e02
Showing
7 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[tool.azure-sdk-build] | ||
type_check_samples = false | ||
pyright = false | ||
mindependency = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
""" | ||
This sample is intended to show how to get a Proof-of-Possession (PoP) token. | ||
""" | ||
|
||
from azure.identity.broker import PopTokenRequestOptions, InteractiveBrowserBrokerCredential | ||
|
||
nonce = "nonce" # needs to be a valid nonce | ||
resource_request_url = "url" # needs to be a valid URL | ||
resource_request_method = "GET" # needs to be a valid HTTP method | ||
request_options = PopTokenRequestOptions( | ||
{ | ||
"pop": { | ||
"nonce": nonce, | ||
"resource_request_url": resource_request_url, | ||
"resource_request_method": resource_request_method, | ||
} | ||
} | ||
) | ||
cred = InteractiveBrowserBrokerCredential(parent_window_handle="window_handle") | ||
pop_token = cred.get_token_info("scope", options=request_options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters