tag:blogger.com,1999:blog-4208378482021219922.post2792824817479083526..comments2024-03-27T03:23:54.906-07:00Comments on Aspiring Architect: Sharepoint Online Authentication for API Access using POSTMANPratap Reddy Pilakahttp://www.blogger.com/profile/17141976956878163883noreply@blogger.comBlogger68125tag:blogger.com,1999:blog-4208378482021219922.post-20944374146009418232023-01-10T08:51:17.346-08:002023-01-10T08:51:17.346-08:00I love you so much!I love you so much!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-67879381785914177412021-12-02T19:42:28.592-08:002021-12-02T19:42:28.592-08:00Make sure you don't have a typo anywhere in te...Make sure you don't have a typo anywhere in tenant url.Erikhttps://www.blogger.com/profile/13727357449376647070noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-777244914580973552021-12-02T19:28:46.583-08:002021-12-02T19:28:46.583-08:00You will get this error if there is a typo in the ...You will get this error if there is a typo in the resource. I had a typo in the tenant name which led to me receiving this error.Erikhttps://www.blogger.com/profile/13727357449376647070noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-32791670644383818242021-11-30T22:41:58.215-08:002021-11-30T22:41:58.215-08:00Thanks for sharing this post with us.Wikivela<br />Thanks for sharing this post with us.<a href="%E2%80%9Dwikivela.com%E2%80%9D" rel="nofollow">Wikivela</a> <br /><br />Anonymoushttps://www.blogger.com/profile/09052462998342723776noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-55789692022933932402021-07-27T19:02:53.843-07:002021-07-27T19:02:53.843-07:00Hi I have same error, have you figured out the fix...Hi I have same error, have you figured out the fix? thankskainoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-35820049017414373092021-07-27T19:01:59.287-07:002021-07-27T19:01:59.287-07:00Hi, I also get the error like others:
{"error...Hi, I also get the error like others:<br />{"error":"invalid_request","error_description":"Token type is not allowed."}<br /><br />I think it's related to some change at Microsoft side for new Sharepoint site. <br />But I still trying to figure out how to fix this.kainoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-42079686834405931372021-07-07T08:43:26.155-07:002021-07-07T08:43:26.155-07:00Hi Pratap,
I am getting below error
"error&...Hi Pratap,<br /><br />I am getting below error<br /><br />"error": "invalid_request",<br /> "error_description": "AADSTS90002: Tenant 'baa501b8-c1cf-4376-ad5f-a02c9e7fac86' not found. This may happen if there are no active subscriptions for the tenant. Check to make sure you have the correct tenant ID. Check with your subscription administrator.\r\nTrace ID: 63b66b28-e489-4b4b-a92f-de8d2fdf3102\r\nCorrelation ID: 741c5664-4379-49f2-b83f-40d27c643b98\r\nTimestamp: 2021-07-07 10:40:46Z",<br /> "error_codes": [<br /> 90002<br /> ],<br /><br /><br />I am accessing SharePoint 2019 On-premises site. I explicitly want to access SharePoint site using this approach in postman(Client requirement). Followed all steps provided from your article. Note: I dont wnat to use NTLM approach because of user name, password security. Please let me where I am wrong also let me know how to acces SharePoint on-premises in Postman using your approach.Nitinhttps://www.blogger.com/profile/16269008392109589685noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-44692448800962728772021-07-05T14:00:39.327-07:002021-07-05T14:00:39.327-07:00Same Error.... Same Error.... Elonoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-46578592659184171472021-04-29T23:24:30.082-07:002021-04-29T23:24:30.082-07:00Hi , I am able to get the token. But the Rest call...Hi , I am able to get the token. But the Rest call is failing.<br />{"error":"invalid_request","error_description":"Token type is not allowed."}Anoophttps://www.blogger.com/profile/03981468019851482700noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-72795425241555363072021-04-24T04:11:19.404-07:002021-04-24T04:11:19.404-07:00Encode your shp_clientSecret ( e.g. replace + by %...Encode your shp_clientSecret ( e.g. replace + by %2B , = by %3D etc)<br /><br />ARUNRAJhttps://www.blogger.com/profile/03228444254046595896noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-54485560244115204022021-04-15T00:56:18.241-07:002021-04-15T00:56:18.241-07:00I cannot figure out without a screenshot of the re...I cannot figure out without a screenshot of the request. Please send me the request so that i can help.Pratap Reddy Pilakahttps://www.blogger.com/profile/17141976956878163883noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-24246792941505396562021-03-25T17:42:51.398-07:002021-03-25T17:42:51.398-07:00Hi, thanks for the great tutorial! Everything wor...Hi, thanks for the great tutorial! Everything works for me except uploading the document. I receive the following<br /><br />{<br /> "error": {<br /> "code": "-2147024891, System.UnauthorizedAccessException",<br /> "message": {<br /> "lang": "en-US",<br /> "value": "Access denied. You do not have permission to perform this action or access this resource."<br /> }<br /> }<br />}<br /><br />Any ideas are much appreciated! Thankscalehttps://www.blogger.com/profile/11445590289084357316noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-38906232536537127822021-03-09T04:49:27.858-08:002021-03-09T04:49:27.858-08:00i too got the same error but iam passing the param...i too got the same error but iam passing the parameters in body. did any solve thisAnonymoushttps://www.blogger.com/profile/06295493555387077364noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-80050668104398136202021-01-11T08:25:49.821-08:002021-01-11T08:25:49.821-08:00Same error here. Please help...Same error here. Please help...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-65989058680062950402021-01-05T14:30:10.395-08:002021-01-05T14:30:10.395-08:00I can't this to work. I tried to different pos...I can't this to work. I tried to different posts, multiple times, but I always get the Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException exception whatever I do. <br /><br />I manage to get to the token, but can't do a request to https://siteURL/sites/siteName/_api/web?$select=Title<br /><br />Anything I could be overlooking?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/00153578523936395607noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-80194023136654719142020-12-16T16:17:49.549-08:002020-12-16T16:17:49.549-08:00why I cant run this link on my share point site..
...why I cant run this link on my share point site..<br />3. This is the most easiest way browse "/_layouts/15/appprincipals.aspx"<br /><br />it display a message :<br /><br />There are no apps having explicit access to the site collection<br />senasanahttps://www.blogger.com/profile/12071897793579781102noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-61717184569782676762020-11-02T15:50:03.577-08:002020-11-02T15:50:03.577-08:00Hi heller
Yes i do, but cant share it as it has al...Hi heller<br />Yes i do, but cant share it as it has all the IDs to missuse my DEV tentant. Sorry.Pratap Reddy Pilakahttps://www.blogger.com/profile/17141976956878163883noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-49034809533126684452020-10-30T12:03:32.965-07:002020-10-30T12:03:32.965-07:00Do you have any postman collection for this?Do you have any postman collection for this?Hellerhttps://www.blogger.com/profile/06026411386172354646noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-76082292020414218952020-10-22T01:10:55.984-07:002020-10-22T01:10:55.984-07:00{"error":"invalid_request",&qu...{"error":"invalid_request","error_description":"Token type is not allowed."} same error gettingmanojjoonhttps://www.blogger.com/profile/15631597149768856134noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-82425109600197061822020-10-22T01:08:05.328-07:002020-10-22T01:08:05.328-07:00Hi I am too getting the same error please help
{...Hi I am too getting the same error please help <br /><br />{"error":"invalid_request","error_description":"Token type is not allowed."}manojjoonhttps://www.blogger.com/profile/15631597149768856134noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-62381285496884335012020-10-22T01:06:19.512-07:002020-10-22T01:06:19.512-07:00Hi Me too getting the same error "{"err...Hi Me too getting the same error "{"error":"invalid_request","error_description":"Token type is not allowed."}" is there any solution please share.manojjoonhttps://www.blogger.com/profile/15631597149768856134noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-90402633618142364292020-10-16T08:02:02.022-07:002020-10-16T08:02:02.022-07:00Hi,
I followed the same steps which are mentioned...Hi, <br />I followed the same steps which are mentioned in this blog. I am able to generate the access token. But I am getting "{"error":"invalid_request","error_description":"Token type is not allowed."}" while trying to access Sharepoint data using the access token. I have all kind of admin access to Sharepoint Site.I am the owner of this site. Can anyone help me on resolving this error.<br />Anonymoushttps://www.blogger.com/profile/06529997654756131128noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-6424092697183361442020-09-03T23:18:31.913-07:002020-09-03T23:18:31.913-07:00Thanks very much for the guide. followed step by s...Thanks very much for the guide. followed step by step, got access token, but received error below when try to access the API: <br /><br />{"error":"invalid_request","error_description":"Token type is not allowed."}<br /><br />Any help would be great appreciated! Anonymoushttps://www.blogger.com/profile/04205576404451927049noreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-70933558058571088012020-08-18T12:42:50.261-07:002020-08-18T12:42:50.261-07:00I had this same issue. I realized I was using the ...I had this same issue. I realized I was using the Resource ID for my specific app instead of 00000003-0000-0ff1-ce00-000000000000 (the actual value highlighted in step 1). This is the principal id for SharePoint. https://docs.microsoft.com/en-us/archive/blogs/kaevans/inside-sharepoint-2013-oauth-context-tokensAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4208378482021219922.post-85991973079613012402020-06-19T12:12:07.891-07:002020-06-19T12:12:07.891-07:00public static void main(String[] args) throws Exce... public static void main(String[] args) throws Exception{<br /> /**<br /> * This function helps to get SharePoint Access Token. SharePoint Access<br /> * Token is required to authenticate SharePoint REST service while performing Read/Write events. <br /> * SharePoint REST-URL to get access token is as:<br /> * https://accounts.accesscontrol.windows.net//tokens/OAuth/2<br /> * <br /> * Input required related to SharePoint are as: <br /> * 1. shp_clientId <br /> * 2. shp_tenantId<br /> * 3. shp_clientSecret <br /> */<br /><br /> String accessToken = "";<br /> String shp_clientId="f83e1c66-f64d-49a1-85e2-207e47092918";<br /> String shp_tenantId="42150afd-062a-4a0f-81b9-0323526054cc";<br /> String shp_clientSecret="28t3QzULzpYlhJhHqt8BTGn+xY/WmQQcokb1SxKryNI=";<br /> try {<br /><br /> <br /> // AccessToken url<br /> String wsURL = "https://accounts.accesscontrol.windows.net/" + shp_tenantId + "/tokens/OAuth/2";<br /><br /> URL url = new URL(wsURL);<br /> URLConnection connection = url.openConnection();<br /> HttpURLConnection httpConn = (HttpURLConnection) connection;<br /><br /> // Set header<br /> httpConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");<br /> httpConn.setRequestProperty("Content-Length", "0");<br /> httpConn.setRequestProperty("Host", "");<br /> httpConn.setDoOutput(true);<br /> httpConn.setDoInput(true);<br /> httpConn.setRequestMethod("POST");<br /><br /> // Prepare RequestData<br /> <br /> <br /> <br /> String jsonParam = "grant_type=client_credentials" <br /> + "&client_id=" + shp_clientId + "@" + shp_tenantId <br /> + "&client_secret=" + shp_clientSecret<br /> + "&resource=00000003-0000-0ff1-ce00-000000000000/naveedtest.sharepoint.com@" + shp_tenantId;<br /> //Here, is "Origanisations's Sharepoint Host"<br /><br /> // Send Request<br /> DataOutputStream wr = new DataOutputStream(httpConn.getOutputStream());<br /> wr.writeBytes(jsonParam);<br /> wr.flush();<br /> wr.close();<br /><br /> // Read the response.<br /> InputStreamReader isr = null;<br /> if (httpConn.getResponseCode() == 200) {<br /> isr = new InputStreamReader(httpConn.getInputStream());<br /> } else {<br /> isr = new InputStreamReader(httpConn.getErrorStream());<br /> }<br /><br /> BufferedReader in = new BufferedReader(isr);<br /> String responseString = "";<br /> String outputString = "";<br /><br /> // Write response to a String.<br /> while ((responseString = in.readLine()) != null) {<br /> outputString = outputString + responseString;<br /> System.out.println(outputString);<br /> }<br /><br /> // Extracting accessToken from string, here response (outputString)is a Json format string<br /> if (outputString.indexOf("access_token\":\"") > -1) {<br /> int i1 = outputString.indexOf("access_token\":\"");<br /> String str1 = outputString.substring(i1 + 15);<br /> int i2 = str1.indexOf("\"}");<br /> String str2 = str1.substring(0, i2);<br /> accessToken = str2;<br /> }<br /> } catch (Exception e) {<br /> accessToken = "Error: " + e.getMessage(); <br /> }<br />}<br /><br /><br />I am getting error while trying to get access token<br /><br />{"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: 86067e1a-5f5a-4783-8f56-29a1daa99700\r\nCorrelation ID: edadff7e-2c28-4f6b-bc4c-15b727762919\r\nTimestamp: 2020-06-19 18:03:20Z","error_codes":[7000215],"timestamp":"2020-06-19 18:03:20Z","trace_id":"86067e1a-5f5a-4783-8f56-29a1daa99700","correlation_id":"edadff7e-2c28-4f6b-bc4c-15b727762919","error_uri":"https://accounts.accesscontrol.windows.net/error?code=7000215"}<br /><br />Using postman with the same configuration i.e. client secret,tenant id i am able to get the access token properly.<br /><br />Uddeshyahttps://www.blogger.com/profile/10197910641092220633noreply@blogger.com