pnp / pnp/powershell

[FEATURE] Connect-PnPOnline with AcessToken to support multiple tokens

Open
#3,925 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Is your feature request related to a problem? Please describe.
We are connecting to PnP using the access token, and it works for most of cases.
However some PnP commands are switching the access tokens dynamically within the single cmdlet, for example, Get-PnPFolderSharingLink. When I captured the web requests issued by this cmdlet, I found that it gets some info from SharePoint endpoints and some from Graph beta. Obviously this scenario can not be supported with a single access token.

Describe the solution you'd like
I would like to specify multiple tokens, each one for certain audience. E.g. in my scenario, I would specify both SharePoint and Graph tokens. Then I would expect that internally PnP module will figure out which access token to use.

I think this syntax will work just fine Connect-PnPOnline -AccessTokens []

This signature will make it similar to how MicrosoftTeams handles similar scenario.

Describe alternatives you've considered
We have quite unique scenario, where access tokens is the best solution for us from the security standpoint. So unfortunately there seem to be no alternatives.

Additional context
N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Connect-PnPOnline entry point and trace how Get-PnPFolderSharingLink selects tokens for SharePoint and Graph beta requests. Define the supported AccessTokens input and verify that both audiences can be supplied and selected correctly during one cmdlet invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.