what is the difference between Gateway URI and Dispatcher URI in cognos - cognos

what is the difference between Gateway URI and Dispatcher URI in cognos ?
https://www.ibm.com/support/pages/framework-manager-cognos-analytics-single-sign-sso-gateway-uri
Why the gateway URI needs a alias ? What is that for?

Related

Rewrite target URL to header value

Can API Management rewrite a backend URL to be the value of a request header? For example, if I have a request originating with header X-ProxyTarget: https://api.ipify.org/, and I send it to https://my-api.azure-api.net/proxy then can a policy (or combination of policies) on inbound (or backend) forward the request to https://api.ipify.org?
You can use the set-backend-service policy in the inbound section. This policy updates the backend URL as provided and read the input header value to set the url.
Sample Code:
<set-backend-service base-url="#(context.Request.Headers.GetValueOrDefault("X-ProxyTarget","http://my-api.net"))" />
References : https://learn.microsoft.com/en-us/azure/api-management/api-management-transformation-policies#SetBackendService

Why does Power Query call Azure API Management backend URL?

I have an Azure App Service hosting an OData endpoint that is behind an Azure API Management (APIM) instance. To prevent calling the App Service directly it is protected by a certificate that only the APIM has.
When I call the APIM URL through Chrome or Postman, it behaves as expected. Just one request with no redirects or funny business, and it returns the OData root.
Here is a Fiddler log of a request to the APIM using Postman
However, when using the same URL as an OData source in Power Query using OData.Feed(), it returns a 301 which forwards to the backend URL, which obviously fails because that URL is protected by a certificate. Here is a Fiddler log of a request to the APIM using Power Query in Excel
I've configured the subscription key to be passed in the headers, but I've also tried it as a query param and it doesn't work in Power Query either way. I've also tried using an OData entity endpoint directly (to avoid the $metadata call) with no luck.
The user agent Power Query uses is Microsoft.Data.Mashup, but I haven't found any documentation about its compatibility with APIM, but that shouldn't matter, right?
In typical fashion after working on this for two days, I discovered the answer right after posting on StackOverflow. I'll leave this question up in case anyone has the same issue.
The problem was that the Power Query connector automatically follows #odata.context links for metadata, and #odata.nextLink links for paging. These links still had the app service site as the host instead of the APIM host.
So a quick edit of the outbound rules in APIM was able to fix the issue
<outbound>
<base />
<set-variable name="backendBaseUrl" value="#(context.Request.OriginalUrl.Scheme + "://" + context.Request.OriginalUrl.Host.ToString() + context.Api.Path)" />
<find-and-replace from="#("http://" + context.Request.Url.Host.ToString())" to="#((string)context.Variables["backendBaseUrl"])" />
<find-and-replace from="#("https://" + context.Request.Url.Host.ToString())" to="#((string)context.Variables["backendBaseUrl"])" />
</outbound>
Here I have to rules to replace http and https URLs just in case some configuration changes.

Azure AD B2C: The redirect URI provided in the request is not registered for the client id... but it actually is

We have the following Azure AD B2C Application (which we will call aadb2c) with the following settings
Include web app/ web API: YES
Allow Implicit Flow: YES
Reply Url:
- https://localhost:44339/
- https://productionURL.com
- https://productionURL.com/
App ID URI (which is optional): none
Native CLient: NO
This Application is what our website https://productionURL.com uses to login it's users with azure AD B2C.
However, on production we keep on getting the error:
The redirect URI 'productionURL.com' provided in the request is not registered for the client id 'aadb2c'
According to this we should add the link to out reply url.
But as you can see above, we already included https://productionURL.com in the "Reply URL" section
of the Azure AD B2C blade.
What could be causing this error to happen? How do we resolve the redirect URI request not registered error?
It needs to be configured in the code as well and you need to make sure that the protocols match. This can also happen if there's a mismatch with the tenant ID or the app ID.
Check the B2C callback request in Chrome DevTools > Network with "Preserve log" to see what URL is being returned. This should give you insight into the problem.
As an extra measure to ensure that the protocols are matching, you can add:
if (context.ProtocolMessage.RedirectUri.Contains("http:"))
{
context.ProtocolMessage.RedirectUri = context.ProtocolMessage.RedirectUri.Replace("http:", "https:");
}
After hours looking at our code and finding no traces of the url without any protocol or any trace of "http:", we now had to look at our deployment orchestrator.
Apparently in Octopus we are deploying the app with an incorrect URI: it's missing the protocol "https://"

Path-based routing without ending slash Azure Application Gateway

I'm currently working on Azure Application Gateway to redirect request to 2 WebApi using Path-based rule as below:
"/foo/*" -> FooApi
"/bar/*" -> BarApi
And a default backend api that does nothing for now.
When I request to http://mygateway.azure.com/foo/, it works fine.
But if I missed an ending slash, so with the URL http://mygateway.azure.com/foo, it returns 500 URL Rewrite Module Error.
Current ApplicationGatewayBackendHttpSettings I set -Path to "/".
I tried to add few more routes to the rule liked "/foo", "/foo/", but it doesn't work.
Any advises, please?

How do you get the client calling URL from ServiceStack Service base class?

I need to log the requesting (client) URL for each request to the service.
I looked through the Request object on the Service base class and the only URL recorded is the service URL requested. Where can I get the requesting caller URL?
You can access the context of the request in your base.Request and base.Response properties in your Service class, e.g:
var requestUrl = base.Request.AbsoluteUri;
var referrerUrl = base.Request.UrlReferrer;

Resources