How to set 'Redirect URIs' in the service settings in Hub - jetbrains-ide

I can access upsource locally using http://pcname:42424/projectname/view.
Trying to access it using the IP eg. http://192.168.1.42:42424/projectname/view yields
OAuth 2.0 Error
unauthorized_client: Unregistered Redirect URI. Client service
'Upsource' requests authorization entity for the URI which is not
registered in Hub: http://192.168.3.143:42424/. If you have Hub
administrator permissions and the suspicious URI does belong to
'Upsource', please add this URI to the list of 'Redirect URIs' in the
service settings in Hub
With link to https://www.jetbrains.com/help/hub/2.0/OAuth-2.0-Errors.html#auth.unauthorized_client
I could not find how to set redirectUri though in Upsource (went through maybe all of the settings pages).
Where can I find the redirectUri setting so I can add my IP to it?
Update
I set up another instance on a different box and set the URL and port to be http://192.168.1.42:42424 and now it works successfully to be accessed remotely using the IP.

For some reason the redirect URI settings area is hidden in Hub even if you're an administrator. I was searching for something else in the JetBrains knowledge base and came across this page which led me to try to add /services to the end of my hub url in my browser:
http://my.serverurl.up/hub/services
Which brings me to this wonderous page with a bunch of configuration options that I can't access through the Administration UI:
FWIW: What I was trying to do initially was configure UpSource to be accessed through a reverse proxy on port 80, instead of the default 8080. I moved my UpSource configuration from one server to another and read the documentation from JetBrains on the subject but it wasn't working.
My mistake: I didn't stop UpSource before running
<upsource_home>\bin\upsource.sh configure --listen-port 1111 --base-url http://upsource.mydomain.com:2222
and UpSource didn't warn me that the command wasn't doing anything. Its message was "UpSource is now running". I stopped UpSource, applied the change and restarted and everything worked. I should've known but I didn't.
Hope that helps someone.

Related

When I front WSO2 public nexus repo with an Azure CDN endpoint, it gives 502-Bad gateway error

I set up an “Azure CDN premium from Verizon” profile and created an endpoint with the configurations shown below.
Name: my-public-nexus-11111
Other configurations:
enter image description here
I wanted to download an artifact from the wso2 public nexus repository (artifact link: https://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/carbon/org.wso2.carbon.core/4.4.10/org.wso2.carbon.core-4.4.10.jar ).
But when I used my CDN endpoint to download this artifact, it gives me a “502 Bad gateway” error.
(Link with the CDN endpoint: https://my-public-nexus-11111.azureedge.net/nexus/content/groups/wso2-public/org/wso2/carbon/org.wso2.carbon.core/4.4.10/org.wso2.carbon.core-4.4.10.jar )
What is the reason for this behavior?
Also just to check whether I‘ve misconfigured something when creating the endpoint, I created another endpoint with the below configurations:
Name: my-test-mvn-central-without-path
oher configurations:
enter image description here
Then I tried to download this artifact with the CDN endpoint link: ​​https://repo1.maven.org/maven2/io/siddhi/siddhi-core/5.0.1/siddhi-core-5.0.1.jar
This can be achieved. The link with the CDN endpoint:
https://my-test-mvn-central-without-path.azureedge.net/maven2/io/siddhi/siddhi-core/5.0.1/siddhi-core-5.0.1.jar
Therefore why the previous CDN endpoint gave me 502 bad gateway error (When configured wso2 public nexus repo as the origin) ?
Also, is it possible to send a request header to the backend?
(Please note that CDN links might not work because I need to stop CDN endpoints to avoid unnecessary costs)
<<<<<<<<<>>>>>>>>>>>
I tried to reproduce the same in my environment like below
I created an Azure CDN endpoint with premium verzion like below:
When I used my CDN endpoint to download artifact, it gives me a “502 Bad gateway” error what is the reason for this behavior?
This error may occur when an HTTP protocol failure occurs between a server and an HTTP proxy. It can't be parsed when customer origin server returns an invalid response to an edge server.
Use Flush DNS cache, In your system DNS cache keeps specific information about the websites you visit.
Try to use ipconfig /flushdns
Try to disable Temporarily disable CDN or firewall.
In WordPress -> Under setting, click CDN -> Disable CDN -> Save.
Or you can temporarily disable the firewall setting to fix the issue like below:
In control Panel -> System and Security -> security and maintenance -> Turn Windows Firewall on or off -> Turn off Windows Firewall
As per Anton Kucer check whether Service Name Indication is turned on at your origin and try to disable SNI setup for SSL binding to resolve this issue. Verify the network connectivity and check whether necessary ports and protocols are open and configured properly.

Hide WVD url using Azure services. FrontDoor? AppGW?

we are doing POC for one client of Windows Virtual Desktop service(2020 spring version)
and client requested to hide url that is being used by default: https://rdweb.wvd.microsoft.com/arm/webclient/index.html, there is no customization of this in WVD service., client want to see like: https://customdomainmain.com/arm/webclient/index.html
So trying to do this with FrontDoor or AppGW (ready to hear other solutions as well)
In both cases I get: 'Message: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application:' searching info for this: suggests to register app in AAD, not sure how but what I tried nothing works.
You can benefit of Azure Functions, which allows you to execute your code in a serverless compute platform and setting your own Custom URL using the corporate domain name. the same idea as myapps.3tallah.com or mail.3tallah.com, for sure it would be up to you to set your preferred subdomain name.
Please refer to this blogpost Configure Custom URL redirection for Windows Virtual Desktop – WVD

Azure frontdoor: The request URI is invalid

I am trying to use azure frontdoor to access a nginx running in a kubernetes cluster.
I can reach the nginx instance on the public IP, but when trying trough azure front door i get a "The request URI is invalid" error.
The health probes also seem to be failing, even though i did not change any settings and can access nginx via the public IP.
Looking at the time where the backend is availible, i don't see any request to the backend:
I have setup my forwarding rules like this:
EDIT:
It seems that i get a different error message when visiting www.1234h.azurefd.net as opposed to 1234h.azurefd.net (no www).
no www gives a "The request URI is invalid" while the one with www gives "Our services aren't available right now".
I guess this was an issue in azure.
A partial fix was:
wait for a couple of hours
Add a web app to the backend, and change routing rules
After about 10 minutes the http domain started working (still no https)
Changing the forward rule back to kubernetes (with no changes to the backend) gave http access.
I guess the steps are not needed, but the issue was resolved around the same time i did the steps.
If i get https access without changing any settings i will report back to confirm if this were a problem in azure and not with my settings.
Other symptoms that lead me to believe this was an azure issue:
There were a few hours were my connection attemps were not registered in the metrics
After the http magically worked, i see my request at the backend graph mathing the frontend requests
Logging does not work properly (i see "Failed to resolve table or column expression named 'AzureActivity'" even though the column are shown in the tables overview)
EDIT:
Https started working while i wrote this answer.
Again, i did not change anything.
I was getting "The request URI is invalid" only when hitting FD via HTTPS. It worked fine for HTTP.
My FD routing rule was configured as such:
But given that I don't care about HTTP, I just configured my app service to be "HTTPS only" and things started working:

Azure WAF infront of Web App changes HostName... Still having problem

I have setup an Azure WAF, via the Azure Portal, to point to an App Service which has a custom domain. The App Service has 2 domain names:
mysite.azurewebsites.com
subdomain.mysite.com
When I select "Pick Hostname from backend address" for the Probe and the Backend HTTP Settings, the Custom domain is picked up. I am also using SSL and this is working. However weirdly when I get past my login page on the app, the Application Gatewoy/WAF seems to resort to using the mysite.azurewebsites.net url. I tried following the recommendation in the following link, but it does not work for me.
Azure WAF infront of Web App changes HostName
Ie I deselected "Pick Hostname from backend address" and put "subdomain.mysite.com" as the hostname. This works for the probe, but when I specifiy this for the hostname in HTTP Settings, I get "Update Failed" without any explanation.
Any thoughts please?
Thanks.
EDIT: If I change the CNAME to bypass the WAF and go direct to the App Service, it works fine.
EDIT2: This may be relevant. The URL gets rewritten post authentication. There are a few links on the login page and these have the correct custom domain in them. However once the user logs in, the app links gets rewritten to use *.azurewebsites.net as the suffix.
EDIT3: Another thought... Is the "Probe" path wrong? I am currently using "/"
From MS docs....
Path / or another path
The remainder of the full url for the custom probe. A valid path starts with
'/'. For the default path of http://contoso.com just use '/'
Just spoke with MS. You need to use the "FQDN" in the backendpool and not the "AppService" option.

Access azure emulator express from external device when azure website uses oauth (google+ sign-in) and https

Well, I spent ages on this so I'll do something I don't normally do which is post a question and answer it in case it is helpful to someone else. If someone finds an easier way I'll gladly accept it.
Requirement: -
Need to access website running on azure emulator from an external device for testing.
Website uses oauth.
Website uses https only.
Problems: -
Azure emulator binds to local.
Google+ sign-in checks valid origin and redirect URIs.
It seems a bit crazy to go through all this just to get an external test going. Perhaps it has been one big yak shaving exercise. So, if there is an easier way, I would gladly accept it.
The solution to problem 1 is reasonably straightforward, there are a number of options, the simplest being to use netsh (assuming 33333 is some arbitrary free port that is accessible through the firewall and 44300 is the https enpoint port that azure is listening on):
C:\WINDOWS\system32>netsh interface portproxy add v4tov4 listenport=33333 connectaddress=localhost connectport=44300 protocol=tcp
This will make azure emulator think that the connection is coming from a local device.
If you are using oauth such as google+ sign-in you will still hit problem 2. This is because the host name of the redirect URL that the server sends does not match what google expects. The solution is: -
Configure a domain for your local network, e.g. test.com. This is needed because google+ does not allow an IP address for the redirect URI.
Edit ServiceDefinition.csdef and set the hostheader for the azure endpoint:
<Binding name="Endpoint3" endpointName="HttpsEnd" hostHeader="station.test.com" />
where station is the name of the computer that azure emulator is running on.
Configure google+ to accept the correct redirect URL, e.g:
http://station.test.com:33333/Account/ExternalLoginCallback
Run visual studio as Administrator. You need to run as administrator otherwise the hostHeader in ServiceDefinition does not work.
From your external device, connect to you computer using the full name:
https://station.test.com:33333
References:
netsh port forward
wrt domain config
Add bindings to your azure role in Azure Compute Emulator
Azure host header

Resources