-
Notifications
You must be signed in to change notification settings - Fork 193
Access Token Proof of Possession Capability #2512
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
base: dev
Are you sure you want to change the base?
Changes from all commits
bc355b0
110a67a
d989cc1
35077ac
d380bf1
c567797
42ef8cb
980929d
9adefff
51cbfc6
d96db06
26496db
88788c1
5b84550
b7f7c7b
ae0b0ba
551a561
7df1cc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Microsoft Graph PowerShell SDK: Access Token Proof of Possession (AT PoP) Capability | ||
|
||
## Overview | ||
|
||
This README provides comprehensive details on the Access Token Proof of Possession (AT PoP) functionality introduced in the Microsoft Graph PowerShell SDK. This feature enhances security by binding tokens to specific HTTP methods and URIs, ensuring they are used only for their intended purposes. | ||
|
||
## Table of Contents | ||
|
||
- [Key Features](#key-features) | ||
- [Installation](#installation) | ||
- [Configuration](#configuration) | ||
- [Usage Examples](#usage-examples) | ||
- [References](#references) | ||
|
||
## Key Features | ||
|
||
- **Access Token Proof of Possession (AT PoP)**: This feature binds tokens to specific HTTP methods and URIs, preventing misuse of tokens by ensuring they are used only for the intended HTTP requests. | ||
- **Updated Dependencies**: Compatibility improvements with recent library changes. | ||
- **Enhanced Token Acquisition Options**: Users can now specify the HTTP method and URI during token acquisition to further secure token usage. | ||
|
||
### Token acquisition behaviors | ||
|
||
| Condition | Unbound (default) | Bound (PoP) | | ||
|-----------|-----------|-----------| | ||
| First sign-in | New token, interactive| New token, interactive | | ||
| Existing token, same URI | No new token, silent | No new token, silent | | ||
| Existing token, different URI | No new token, silent | New token, silent | | ||
| Existing expired token, below max token refreshes | New token, silent | New token, silent | | ||
| Existing expired token, exceeded max refreshes | New token, interactive | New token, interactive | | ||
|
||
## Installation | ||
|
||
To install the Microsoft Graph PowerShell SDK with the latest updates, use the following command: | ||
|
||
```powershell | ||
Install-Module -Name Microsoft.Graph -AllowClobber -Force | ||
``` | ||
|
||
Ensure you are using the latest version to access the AT PoP functionality. | ||
|
||
## Configuration | ||
|
||
### Enabling Access Token Proof of Possession | ||
|
||
To enable AT PoP, configure the Microsoft Graph SDK options as follows: | ||
FehintolaObafemi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```powershell | ||
Set-MgGraphOption -EnableATPoP $true | ||
FehintolaObafemi marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we release this specific feature as preview / experimental? Does MS Graph PS have this capability? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good idea. @timayabi2020 can this be released as a preview version similar to the version 2.0 roll out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it can, however I think we should first publish the feature to an internal feed and get a few guys to test internally |
||
|
||
Connect-MgGraph | ||
``` | ||
|
||
This configuration ensures that the acquired token is only valid for the specified HTTP method and URI. | ||
|
||
## Usage Examples | ||
|
||
### Example 1: | ||
|
||
```powershell | ||
Set-MgGraphOption -EnableATPoP $true | ||
|
||
Connect-MgGraph | ||
|
||
Invoke-MgGraphRequest -Method GET https://graph.microsoft.com/v1.0/me -Debug | ||
``` | ||
|
||
### Example 2: | ||
|
||
```powershell | ||
Set-MgGraphOption -EnableATPoP $true | ||
|
||
Connect-MgGraph | ||
|
||
Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/v1.0/me/sendMail" -Method POST -Debug | ||
``` | ||
|
||
## References | ||
|
||
This README provides a detailed guide on the new AT PoP functionality, offering users the ability to secure their token usage effectively. If you have any questions or need further assistance, please refer to the official [Microsoft Graph PowerShell SDK documentation](https://docs.microsoft.com/en-us/powershell/microsoftgraph/). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
// ------------------------------------------------------------------------------ | ||
|
||
using Azure.Core; | ||
using Azure.Core.Pipeline; | ||
using Azure.Identity; | ||
using System; | ||
using System.Net.Http; | ||
|
||
namespace Microsoft.Graph.PowerShell.Authentication | ||
{ | ||
public interface IGraphRequestPopContext | ||
{ | ||
Uri Uri { get; set; } | ||
HttpMethod HttpMethod { get; set; } | ||
AccessToken AccessToken { get; set; } | ||
HttpPipeline PopPipeline { get; set; } | ||
InteractiveBrowserCredential PopInteractiveBrowserCredential { get; set; } | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.