Pass multiple domains to restrict - in "hd" parameter in Google OAuth - google-oauth

I'm using Google OAuth for account linking.
I'm setting hd parameter to restrict particular domains (Ref), and it's working fine.
but my question is can I restrict more than one domains?
like currently I'm setting hd as
"hd": "jaypatel.co.in"
But what if I want to allow two or three domains instead of just
jaypatel.co.in? is there any way to do that?

I know that I arrive a bit late but I tried to pass different domains as an Array
hd: ['mydomain1.com', 'mydomain2.com']
and it seems to be the behavior you looked for.

Related

Can we set any number of Redirect URI in a application for multiple users?

I am working on a multitenant application where we will have multiple base urls based on our customers.
Here I have a requirement to set Redirect URI for each customers. My confusion is can we set any number of uri in an application? Or Is there any limitation or maximum limit of creating the uri?
This application is created as microservice.
Not sure if I get your question right, maybe an example would be beneficial.
In general, you can use path parameters to make an URI customer-specific, e.g. /pre-path/customer/{customerId}/redirect. This is basically one path, but customerId is used as parameter to distinguish multiple users and can have "infinite" different values.

Show different website based on the current State on AWS using Cloudfront/S3

We want to show a different website depending on the current State of the visiting user, is it possible? I've seen you can do Restriction, but I guess this is kind of the opposite.
Without a Redirect would be awesome, ie. using different S3 buckets.
You can use Lambda#Edge to inspect the request and redirect the user as you wish.
Here is a standard pretty URL redirect example that you can adjust to your needs.
You can also add multiple origins e.g. S3 buckets and use path matching pattern to direct traffic based on the URL to specific path.

Display Domain suggestions having keywords appended in suggestions - WHMCS domain checker

I'm working on WHMCS Latest Version 7. On submitting domain checker form, usually we get the domain availability information and domain suggestions with other extensions. For example: If we search for example.com, We will get a set of suggestions as follows.
example.net
example.org
I need another set of suggestions with some set of words appended with the keyword user selected as follows
theexmaple.net
myexample.net
exmapleonline.net
theexmaple.org
myexample.org
exmapleonline.org
Domain suggestions are implemented by Domain Registrar modules. You can use eNom or ResellerClub for their built in suggestions. Both of those will attempt to use related words in the name to get a better suggestion. If you want behavior exactly like you described, you can write a custom domain registrar module that adds the common prefixes and suffixes you're interested in and then returns results.
http://developers.whmcs.com/domain-registrars/availability-checks/

Different results locally and in staging

I'm using google custom search engine with a search engine that searches specific sites and excludes some patterns in these sites.
I'm testing the api locally and I receive 12 results. I test the same exact call in staging (heroku us region) and I receive 410 results.
Does google personalise the results when using a custom search engine?
If yes, how do I turn it off? If no, do you have any idea why am I seeing this difference?
Update
Ok I did a test. I issued the exact same request by using a proxy and not, and the results are different (vastly).
Now, the question is, can this behaviour be disabled?
Ok found it. By specifying the userIp param https://developers.google.com/custom-search/json-api/v1/using_rest it will force google to use the same behaviour regardless of location.

Planning url rewrite for my web app

I'm working on a site which shows different products for different countries. The current url scheme I'm using is "index.php?country=US" for the main page, and "product.php?country=US&id=1234" to show a product from an specific country.
I'm planning now to implement url rewrite to use cleaner urls. The idea would be using each country as subdomain, and product id as a page. Something like this:
us.example.com/1234 -> product.php?country=US&id=1234
I have full control of my dns records and web server, and currently have set a * A record to point to my IP in order to receive *.example.com requests. This seems to work ok.
Now my question is what other things I'd need to take care of. Is it right to assume that just adding a .htaccess would be enough to handle all requests? Do I need to add VirtualHost to each subdomain I use as well? Would anything else be needed or avoided as well?
I'm basically trying to figure out what the simplest and correct way of designing this would be best.
The data you need to process the country is already in the request URL (from the hostname). Moving this to a GET variable introduces additional complications (how do you deal with POSTs).
You don't need seperate vhosts unless the domains have different SSL certs.