Authenticate before Hitting External URL - authentication

I have a site hosted publicly with quite a complex name (including Guid) lets say Site_1, and I have another site hosted publicly at IIS with user friendly name lets say Site_2. I want to redirect my request coming to Site_2 for specific path to Site_1, without showing the address of Site_1 in URL, instead show the URL for Site_2.
On top of that I want to do an authentication before somebody can hit site Site_1, either via Site_2 or via copy pasting a URL for Site_1.
One of the solution that I have applied and achieved successfully is using NGINX Reverse Proxy and its basic or external authentication.
I am looking for example for doing same in IIS or any other platform, or any coding that needs to be done at Site_2.

Related

Sharepoint URL redirection

I am trying to achieve URL redirection i want to know different possibilities to achieve this.
Scenario: I have created sharepoint web application(2013, host header site collection) with Annonymous access enabled and NTLM(windows authentication enabled--- Both are enabled). I have bind this site to certificate also and its working as expected if i browse the site with https://test.com
but if i just browse the site with http://test.com its asking me for user name and password. This i want to avoid even if i try to access http my requirement is it should redirect to https.
I have entered username and password and returns 200 http status.
I know there are options we can achieve this
1) IIS redirect
2) Through custom code snippet (C#/Javascript)
But apart from this is there any way we can achieve this like load balance or DNS etc
Your guidence will be really help full.
Regards
Sri
I think you can achieve this by addin an AAM (Alternate Access Mapping) setting in a sharepoint site.
Try to convert an Https request to the http in that. I haven't tried it myself so I am not sure if this will work or not, but there are some examples of a reverse which you want.
For your reference this is a link to make it for http to https
https://sharepoint.stackexchange.com/questions/64484/http-to-https-redirection-using-aam
Let me know the outcome.

Infer a parameter in a WEB app depending on the URL

I'm developing a database backed web-app. I will be providing the same basic services to several branches of the same company.
Right now I have an Apache server with virtual servers and a resource server for reporting.
branch1.mycompany.com
branch2.mycompany.com
resources.mycompany.com
So basically when I call resources from the site I pass the site as a parameter.
branch1.mycompany.com -> resources.mycompany.com?branch=1&parameter=1
branch2.mycompany.com -> resources.mycompany.com?branch=2&parameter=1
Even with two branches there is a problem trying to keep up with updating both sites and now, I'm going to be implementing this scheme for seven sites.
So my question is this: Is there a way I can make a IIS or TomEE web-app with the following features?
I want to still allow each branch to access trough its URL
Even when there are 7 URLs; all of them will be pointing to the same web-app
Depending on the URL, is there a way the site parameter can be inferred or calculated so I can call the right resource or web service?
The user should never realize they are accessing a common web-app. (i.e. should not be redirected to web-app.mycompany.com?site=1.)
Tomcat (so tomee) has now a rewrite valve which is close to httpd mod_rewrite, this can surely solve that smoothly. I assume IIS has it as well but don't know it that much. Trick is to reverse proxy the requests.

How can you rewrite an internal link access from external hostname?

What if I have some internal links on my xampp web server that need to get accessed by external (requests from the internet)?
Lets say http://mylocalsite.local/login/ is a link on the site.
if I click on this link from http://externalwebsiteaddress.com, which should redirect to my webserver. Can the internal link (mylocalsite) be rewritten to http://externalwebsiteaddress.com/login ? Because currently external requests give a "Cannot access this page error" because its internal.
I don't want the internal link to redirect to the external link when accessed from within the network.
Basically if the links are internal , then find a way to service the request from external website successfully, without having to physically change the link on the server.
in other words
If the user is accessing from an external internet link, then find a way to redirect to proper folder using external link so it can be resolved properly.
EX: All links start with http://externalwebsiteaddress/wherever
If user is accessing from internal (inside the network) , then use the local links.
EX: All links start with http://internaladdress/wherever
Would this be a mod_rewrite? I am confusing myself way to much.

url subdomain wildcard redirect

I read some of the answers related to the topic but my situation is a little different. I'm hosted on GoDaddy shared Linux hosting. Currently my application is setup to handle uri's as follows:
https://state.domain.com/region/client/xyz/function1
I want to change the application so the new url will be as follows. The change has been implemented and working for new clients but for my existing clients I want to this to be seamless without having them to update the url they are using to access the application. The new url would be:
https://country.domain.com/state/region/client/xyz/function1
We have quite a few clients that are using the application and I was wondering if we can use wildcards to create generic redirection. What would be the best way to achieve this?
I was reading subdomain redirection through htaccess but in my case I need the generic redirection to give me the complete uri so for example in the above case the redirected uri should be exactly as specified above. In another case if the incoming request is for
.../region/client/xyz/function2
It should be redirected to
.../state/region/client/xyz/function2
Any help would be really appreciated

Magento SOAP API V1 changing soap:address location

We have a multistore magento setup thats still half in development. But we have 1 of the stores open with a test url.
e.g
test.domain.com
However when we go to: http://test.domain.com/index.php/api/index/?wsdl=1
I noticed that soap:address shows the main domain not the api url e.g:
<soap:address location="https://www.domain.com/index.php/api/index/index/?SID=vnl0ijdobf6ldj76pmc658rj92"/>
Which atm isn't live.
We have no issues with 3rd parties who come in on the V2 api but this doesn't seem to have a soap:address which I believe is the problem.
When I go to: http://test.domain.com/index.php/api/index/?wsdl=1 in a browser it shows xml.
When I try and make a soap call i get: looks like we got no XML document.
When I update my local hosts file with the new ip to point at the domain it will work.
But the 3rd party can't update their server because its shared hosting. Is there a way to change the API to point at the api url and not the base store url?