We are relying on refering urls when we pick up requests from users who installed our widget, it's just and iframe, similar to Google plus button, Facebook Like etc.
Recently we noticed that Google's blogspot blogs can be accessed using multiple urls with different ending like:
*.blogspot.com
*.blogspot.fr
*.blogspot.co.uk
...
Now our database is getting filled with duplicate websites.
Is there any way to get real address every time like *.blogspot.com
Are there any other websites that do such a thing, make themsalves available through different domains without redirecting to real one, or is blogspot specific?
How does facebook handle this, do people that own blog on blogspot have different like count for different domain?
You can do a dns lookup for CNAME entries.
var host = Dns.GetHostByName("www.blogspot.com").HostName;
// host == "blogger.l.google.com"
If the host DNS contains a CNAME, the HostName property will return the CNAME.
The following description my be helpful:
A CNAME record or Canonical Name record is a type of resource record
in the Domain Name System (DNS) that specifies that the domain name is
an alias of another, canonical domain name. Here "canonical" usually
means: a more generally accepted or standard name.
(Wikipedia)
Related
Problem trying to solve: Move the URLS from the config and use class type to dynamically substitute the URL. I have one Website configured in IIS with multiple Host Names.
I am working on Art Academy website using .NET Framework WEB API + React (SPA).
Students have two option of ClassType - it can be either 1) Dance Or 2) Art
> if Dance is choosen i want them to see URL - myDomain.classesForDance.com
> else if Art is choosen i want them to see URL - myDomain.classesforArt.com
Both URL points to same website except change in LOGO and some other minor details
which are handled in code based on classType selected by the students
I am trying to resolve how do i go about IIS binding with multiple host names so that i don't have to manage two websites. IIS will have one website where it points to two Host Names as below:
myDomain.classesForDance.com
myDomain.classesforArt.com
In the appSettings.config (web.config) I have URL for various environments like QA, Stage, Prod etc
For example, on QA
SignInUrl="http://login.qa.classesForDance.net/auth?siteCode=DANCE"
AuthenticationDomain=".qa.classesForDance.net"
What i want to do is, i want to dynamically send back URL like
Either LogInUrl=http://login.qa.classesForDance.net/auth?siteCode=DANCE
OR LogInUrl=http://login.qa.classesforArt.net/auth?siteCode=ART
based on student's class selected as per their profile. Move the URLS from the config and use selected class type to dynamically substitute the URL.
How do i go about solving this problem
Note** System.Web.Hosting.HostingEnvironment won't solve as I can only access properties like SiteName etc.
What i need is correct URL based on ClassType students have opted for.
One solution i have thought so far is to come up with a service which first reads the DB and replaces the appSettings.config - config URL based on ClassType. I don't want to add more Keys to AppSettings for another hostname, for example what if i add another classType - singing in future - the design should be able to accommodate easily without much changes in code and simply by adding one more classType in DB - return myDomain.classesforSinging.com
Is there any better or alternative approach someone can suggest? Anything i need to consider while handling this problem?
How can I retrieve the call forwarding (routing) rules of a lyn client using UCMA or MSPL?
I have tried to retrieve it using a UserEndpoint and subscribing to the PresenceNotificationReceived event of RemotePresenceView.
Unfortunately this seems not to work. According to the msdn documentation it is only possible to query the route category with a local-access (LocalOwnerPresence).
Another options would be to use an ApplicationEndpoint of impersonate every user for which I want the retrieve the call forwarding rules. But in my eyes this seems to be a dirty solution.
Could this be also be done with MSPL?
In my tests this:
Another options would be to use an ApplicationEndpoint of impersonate every user for which I want the retrieve the call forwarding rules. But in my eyes this seems to be a dirty solution.
Has been the only working solution (outside of querying the database directly).
If you want this done in MSPL, look at QueryCategory. The problem there is you will need the correct ContainerNumber and Instance ids.
However, if you look them up (See MSDN for Presence data source and category instance ID) you will find there is no instance numbers listed for routing. The container number info can be found here: Routing category instance value element, and that one does list some instance IDs.
Interesting point is that routing data is classified as "local only", see Local-access only category instances:
The routing category instances contain routing rules to forward inbound calls made by any members of a hosting container. They are private category instances and are not visible to the remote users who are members of the hosting containers.
So far I have not found a combination of name ('routing'), ContainerNumber and Instance id that give any results, so please update if you find anything.
I need help with retrieving all possible properties(Distinguished Name , etc) and values from a LDAP server using C# 4.0 code.
My end user is simply going to enter the name of the LDAP server in my application.
The LDAP server can be a private server or an open LDAP server as available in this page Public LDAP servers.
I am using System.DirectoryServices.Protocols.LdapConnection class to connect to the LDAP servers and System.DirectoryServices.Protocols.SearchRequest class to retrieve the values.
Here's my problem :
The System.DirectoryServices.Protocols.SearchRequest class requires the distinguished name of the server as a parameter to retrieve users, group etc.
My end-user will simply be entering the server name.
I have to get the distinguished name from the server via my C# code. I am unable to find(even google out) a C# solution for my problem.
I found an application online that actually does what I wanted.
I simply provided LDAP server name and it retrieved the values(distinguished name, port no, etc) from that server.
Could someone please provide me a solution to get the values using C# .NET 4.0.
I cannot use any paid third party softwares or dlls.
LDAP does not use properties, it has attributes. To fetch attributes from a server, an LDAP client must connect to the server, authenticate the connection using the BIND request, and then transmit a search request to the server and interpret the server's response. A search request consists of the following at a minimum:
base object
search scope
search filter
list of attributes to retrieve
Properly coded LDAP clients will include a size limit and time limit in addition to the above required elements.
The search result from the server will contain an integer result code, and a list of objects that matched the search request parameters (filtered by the search filter). A search can be successful but return no entries.
If the base object is not known, transmit a search request for the namingContexts attribute in the root DSE. The root DSE can only be obtained by using a base object of "" and a search scope of 'base'. The filter should be (&) or (objectClass=*). The directory server publishes certain information, including the namingContexts, in the root DSE, although that information is subject to access controls like everything else.
see also
LDAP: Search Best Practices
LDAP: Programming Best Practices
LDAP: The Root DSE
We have a web application : C# + SQL 2k5
Different companies send us information, we parse, them, do different things, and come up with a simple list for each of our customers. The list will look the same, but will have different information based on the customer.
They should not have access to each other's data.
We would like to create a page which would be embedded on their own site. I was thinking about using something like an iFrame.
Basically customer ABC would embed on his own abc.com an iframe with a URL (we will give them the parameters needed) and his clients will see our data on his site.
The other customer, lets call him xyz, has an other website xyz.com, will do the same thing, but in the url I should make a difference between them.
I would like to know how is the best, safest way to proceed.
How should I start to build up this page that is going to be embedded.
How should I make a difference between the 2 customers? The only way to get info from them is the parameters they send me, and eventually, I could get the 'parent' of my embedded iFrame, so that might help me restrict xyz to embed using url parameter info to get data from abc. See my dilemma?
Probably a unique identifier for each customer (like a GUID?) will be needed, and they woul dnot know each other's ID ... Or is there a more secure way to do things like this?
Any help would be appreciated.
Thanks
Embed a publically visible unique id in the URL and process this to extract the client id. e.g.
<IFRAME src="http://example.com/1122334455667788aabbcc">
You could check the Request.UrlReferrer to ensure that the request see this answer
However the only safe way of doing this is to provide an authenticated API that the site uses server side to process via a services API (e.g. WCF), or at the very least an authenticated HttpWebRequest; any other way leaves your data only as secure as a publically visible unique id.
Take a look at how one of the credit card processing portals do this (eg WorldPay or Paypal). There are several ways.
At the very least you need provide each customer with a unique ID that they send you.
e.g. for mail.google.com would it return google.com or mail.google.com?
I can't actually test it myself
It does include subdomain (e.g. mail.google.com)
You can save yourself from the headache of waiting for answers by reading documentation on Msdn.
A String that contains the host name. This is usually the DNS host name or IP address of the server.
If the requested DNS record is a subdomain, that's the record it will return. Subdomains are still there own records in a zone file, so its not going to return just the root domain because that's not the same record, nor request.
I was also curious as to why you couldn't test this, but if its because of the lack of an internet connection (maybe you're posting from mobile I don't know) you can add your own records to the Windows HOSTS file and test locally.