-
Notifications
You must be signed in to change notification settings - Fork 211
Adds Client Secret Credentials Support #1555
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
Conversation
authContext.TokenCredentialType = TokenCredentialType.UserProvidedAccessToken; | ||
authContext.ContextScope = ContextScope.Process; | ||
GraphSession.Instance.InMemoryTokenCache = new InMemoryTokenCache(Encoding.UTF8.GetBytes(new NetworkCredential(string.Empty, AccessToken).Password)); | ||
authContext.AuthType = AuthenticationType.AppOnly; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this cause user confusion when users inevitably try to use -Credential
within Connect-MgGraph
for ROPC / User Credential auth flow use with delegated permission types? I get that you're only intending to add support for client secrets / App Only, I just think in the process it might be creating UX confusion.
Perhaps an alias or rename of the parameter could aleviate this. -ClientSecret
, -ClientSecretCredential
, -AppCredential
, or -AppSecret
might be a few possibilities.
#125 (comment) - Looks like it already has created some confusion unless I've completely misunderstood the code. Keep me honest here.
This is completely wrong and confusing #1366 and similar should not be closed as the expectation was to add support for non-interactive username/password login |
On top of that, the v2 module no longer accepts tokens acquired with MSAL.PS
|
You need to convert the string token to secure string to use with the v2 module. That was documented in the breaking changes. MSAL.PS isn't broken. That said, I do agree about the credentials parameter being confusing as I documented above. |
This PR closes #1366 by adding
-Credential
parameter of type PSCredential toConnect-MgGraph
command.The parameter is being added to:
Proposes Usage