SAP Knowledge Base Article - Public

3229920 - The query string "redirect_uri" is missing or invalid when trying to create SharePoint connection in SAP Analytics Cloud & SAP Digital Boardroom

Symptom

The following error occurs in SAP Analytics Cloud (SAC) when trying to create Open Connectors SharePoint connection in SAP Analytics Cloud :

  • Sorry, something went wrong. The query string "redirect_uri" is missing or invalid.
  • Missing or invalid query text "redirect_url"

Environment

  • SAP Analytics Cloud (Enterprise) 2021.08.14

Reproducing the Issue

  1. Create Open Connectors SharePoint connection.
  2. Upon clicking on the Save button observe the error message.

Cause

Microsoft recently changed SharePoint / Azure OAuth app redirect URIs and client secret validity behaviours.

You can independently verify the behaviour without SAP Analytics Cloud and use a browser to perform the test.  Open a browser and hit SharePoint team with:

https://<URL_to_SharePoint_site>/_layouts/15/OAuthAuthorize.aspx?redirect_uri=<Redirect_URI>&client_id=<Client_ID>&response_type=code&scope=<Scope>&state=sharepoint

Replace the following placeholders:
<URL_to_SharePoint_site>
<Redirect_URI>
-- You will need to replace all : as %3A
-- You will need to replace all / as %2F
-- Example: https%3A%2F%2Foauth-r.cfapps.sap.hana.ondemand.com%3A443
<Client_ID>
<Scope>
-- Example: AllSites.Manage

If you are seeing "Do you trust <app_name>?" then the setup is OK.

If you are seeing "Sorry, something went wrong The query string "redirect_uri" is missing or invalid." then the redirect URI is not accepted by SharePoint for the given Azure OAuth app.

Apperantly multiple redirect URIs in Azure OAuth app is not working as expected.  When you registers additional redirect URI, it may have "random" sorting placement in your Azure OAuth app > Authentication > Web > Redirect URIs.  Only the top entry in redirect URI will work to authenticate in SharePoint.

Even if you try to delete redirect URIs in Azure OAuth app > Authentication > Web > Redirect URIs to manually change the sorting order, it would not take effect as to which redirect URI would be accepted by SharePoint.  You can verify this behaviour be deleting the top redirect URI entry from Azure OAuth app, but it would still be accepted by SharePoint as valid redirect URI.

(As tested on 2021 October 25.)

Resolution

Create a new Azure OAuth app and set to the correct redirect URI the first time, then verify in Azure OAuth app > Authentication > Web > Redirect URIs.

As the current/best workaround to find your redirect URI for your SAP Analytics Cloud tenant without checking the user guide, try to create a new "OData Services" connection in SAC, change Authentication Type to "OAuth 2.0 Authorization Code" then you will be able to see the redirect URI at the bottom of the dialog.

To verify the setup, open a browser and hit SharePoint URL with:

https://<URL_to_SharePoint_site>/_layouts/15/OAuthAuthorize.aspx?redirect_uri=<Redirect_URI>&client_id=<Client_ID>&response_type=code&scope=<Scope>&state=sharepoint

Replace the following placeholders:
<URL_to_SharePoint_site>
<Redirect_URI>
-- You will need to replace all : as %3A
-- You will need to replace all / as %2F
-- Example: https%3A%2F%2Fbocauth.us1.sapbusinessobjects.cloud%3A443
-- Example: https%3A%2F%2Foauth-r.cfapps.sap.hana.ondemand.com%3A443
<Client_ID>
<Scope>
-- Example: AllSites.Manage

Note, currently the maximum client secret is valid for 24 months and cannot no longer create one with no end date (12/31/2299).

See Also

Your feedback is important to help us improve our knowledge base.

Keywords

SAP Cloud for Planning, sc4p, c4p, cforp, cloudforplanning, Cloud for Analytics, Cloud4Analytics, CloudforAnalytics, Cloud 4 Planning, BOC, SAPBusinessObjectsCloud, BusinessObjectsCloud, BOBJcloud, BOCloud., SAC, SAP AC, Cloud-Analytics, CloudAnalytics, SAPCloudAnalytics,Error, Issue, System, Data, User, Unable, Access, Connection, Sac, Connector, Live, Acquisition, Up, Set, setup, Model, BW, Connect, Story, Tenant, Import, Failed, Using, Working, SAML, SSO, sapanalyticscloud, sap analytical cloud, sap analytical cloud, SAC, sap analyst cloud, connected, failure, stopped, sap analyst cloud, https://hcs.cloud.saphttps://hanacloudservices.cloud.saphttps://cloudanalytics.accounts.ondemand.comhttps://hanacloudservices-us.accounts.ondemand.comhttps://www.sap.comhttps://help.sap.com, predictive analytics (analysis), data analysis (analytics) tools, analytics tools, sap analytics cloud, data literacy, advanced analytics, data democratization, analytics software, real time analytics, self service analytics, advanced data analytics, analytics as a service, analytics cloud / cloud analytics, saas analytics, cloud bi, enterprise planning, cloud data analytics, cloud based analytics, analytics cloud platform, modern analytics, real time analysis, cloud analytics solution(s), what is sap analytics cloud, cloud analytics tools, analytics in the cloud, cloud analytics software, SharePoint, Share Point, connection, redirect_url, missing or invalid query text "redirect_url" , KBA , LOD-ANA-ADM , SAC Administration , Problem

Product

SAP Analytics Cloud 1.0