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

Login using SharePoint App-Only instead of AAD App-only? #134

Open
vamsi981 opened this issue Jan 9, 2023 · 8 comments
Open

Login using SharePoint App-Only instead of AAD App-only? #134

vamsi981 opened this issue Jan 9, 2023 · 8 comments

Comments

@vamsi981
Copy link

vamsi981 commented Jan 9, 2023

Hi @estruyf ,

Is it Possible to use SharePoint APP-only Add-In Client id and Secret Instead of M365(Azure based) Client id and Secret, where the scope is only limited to particular Site Collection Instead of entire SharePoint tenant level.

@vamsi981
Copy link
Author

vamsi981 commented Jan 9, 2023

In our Scenario, we are using SharePoint add-in for connecting to a Site Collection for publish/creating Pages. with the package can we use the Same for publishing pages using M365 CLI?

@gkohen
Copy link

gkohen commented Jan 9, 2023

Hi @estruyf. First of all thank you for this top notch library. Looks like it got lots of potential. On the question of @vamsi981
above, please let us know if we can contribute and it might be as simple as delegating a new auth mode(client/secret) on this class or you see additional complications.
Thanks!

@estruyf
Copy link
Owner

estruyf commented Jan 9, 2023

@gkohen contributions are more than welcome! Haven't been using doctor for a long time, so contributions are helpful to get it better by people who actually use it.

@gkohen
Copy link

gkohen commented Jan 9, 2023

No worries @estruyf. On the specific issue of the technical question raise by @vamsi981, do you see any issue with the current implementation being able to create pages if we contribute a client/secret auth support?
On a side note related to your last comment, do you know is this tool being actively maintained and used by the community?

@estruyf
Copy link
Owner

estruyf commented Jan 9, 2023

It uses the CLI for Microsoft 365, which is actively maintained. This library is a wrapper around that dependency, with the ability to understand how to translate the markdown content to SharePoint Pages.

We need to check if the CLI can be used with client/secret auth. If it does, it would be an easy way to be implemented it.

Happy to also bring some new life in the library, as it has a huge potential for teams.

@bentolor
Copy link

In my environment a login using user/pass leads to an Error: invalid_client: 7000215: AADSTS7000215: Invalid client secret provided.. But I also got a client secret.

  • localm365 uses an old m365 v3.x version, which doesn't seem to understand client secrets
  • a current m365 allows me to successfully login using the following command:
m365 login --authType secret --secret "secret" --tenant "xxx" --appId "xxxx"

Any reasons for the really outdated version of the bundled m365, @estruyf ?

@bentolor
Copy link

Ok: With my limited understanding I hacked an updated version to use client secret authentification, but eventually I received this feedback from m365:

Error: SharePoint does not support authentication using client ID and secret. Please use a different login type to use SharePoint commands.

Not sure if I'm on the same page as the others on this thread, but it seems I'm not able to go that path.

@gkohen
Copy link

gkohen commented Jan 20, 2023

Digging deeper into the PNP CLI it seems like there is an actual blocker on the Microsoft service API:
pnp/powershell#277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants