-
Notifications
You must be signed in to change notification settings - Fork 9
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
Issue in retrieving taxonomies #19
Comments
Hi, could you tell me what exact issue do you have? What is the error code or maybe a stack trace? |
Hi @s-KaiNet , Unfortunately the only response I'm getting says "OAuth only flow is enabled and the call has not been issued from an app". I thought there was an issue with the App permissions set for the Term Store but then I was able to successfully get a response from Postman: that's why I switched to @pnp/sp-taxonomy and pnp-auth libraries, which are working fine but the former library is throwing a lot of these warnings: _(node:2804) Warning: Accessing non-existent property 'ControlMode' of module exports inside circular dependency That's why I was hoping to achieve the same result with sp-request and move away from the other libraries. Anyway, this an extract of my code using the @pnp/sp-taxonomy and pnp-auth (which is working):
` Thanks again for your help. |
If pnp-auth works, then sp-request also should work. You could try inspecting HTTP requests to see the difference in the headers and authentication. Also, which kind of authentication do you use for sp-request? Is it the same as for pnp-auth? |
Yes, the authentication works fine, because I was able to upload files in SP as well as update several fields; the problem seems when I try accessing taxonomies: I tried this with sp-request which gave me the "OAuth" issue:
Here the URL is different: in my previous example, the URL was simply https://<TENANT_ID>.sharepoint.com , instead this time I tried to directly access the term store (I wasn't sure what else I could do, since it seems SharePoint doesn't have specific methods like 'GetByTitle' for lists when it comes to Taxonomies...) The documentation I found suggested to use the Client ID and Secret ID, or the Bearer token, but I need to keep using username and password... Thank you @s-KaiNet :) |
Does it work when you use a Client ID and Secret ID? Also maybe it doesn't work because legacy auth is disabled for you? You can try executing Get-SPOTenant and inspect |
I haven't tried the Client ID and Secret ID, but I've just generated the Bearer token from Postman and I passed it in this way and it worked:
Is there a different authentication protocol that it's working for the Bearer authorization? OAuth 2 maybe? Or am I missing something else? |
When you use bearer tokens, then it's OAuth, with username\password it's cookie based auth, and it looks like it doesn't work with new taxonomy REST endpoint ( |
So I guess there's no workaround for this, is there? :( |
I'll try that so and see what I get... I guess if I get something working properly I might add send a merge request to extend sp-request :) |
Hi there,
I tried to use this module to retrieve a specific term store but I got an OAuth issue when I tried to hit the following endpoint (which works fine from the browser):
https://<TENANT_ID>.sharepoint.com/_api/v2.1/termStore/groups/<GROUP_ID>/sets/<SET_ID>/terms
So I successfully used pnp_auth and @pnp/sp-taxonomy modules, but I was wondering if I can achieve the same result with sp-request library as it's quite handy the way for the authentication with credentials, and doesn't require other libraries), especially because I had to use an older version of the above modules, which are giving me several warnings (e.g. Accessing non-existent property 'ControlMode' of module exports inside circular dependency ).
If this functionality is already there, would you be able to provide me with an example of how to properly access a term store please? If not, would it be possible to introduce it in the next release?
Thank you very much.
Regards
The text was updated successfully, but these errors were encountered: