How to change the hostname in a redirect url to keycloak? - keycloak

Suppose the application and keycloak are installed on the same machine. If the user with the browser is also on that machine, localhost is used everywhere and everything works.
But now the user is on another machine, and tries to access a page, which requires a login via keycloak,
http://applandkeycloakmachine:8080/resource
Then there follows a redirect:
http://localhost:9080/auth/realms/myrealm/protocol/openid-connect/auth?response_type=c...
But on the machine where the user is is no process on port 9080. So how can you change the hostname in the redirect url?

Related

Change meteor accounts-google redirect uri

I have a meteor app with the accounts-ui and accounts-google packages installed. However, when I set up the client id and secret, the app set the redirect uri as localhost. So whenever I access my app from a remote location, it redirects me to localhost, but I'm remote, so it just tells me it can't connect to localhost. Is there anyway to tell meteor that when I'm connecting local, the redirect uri is localhost, and when i'm connecting remote, the redirect uri is the remote location? Thanks.

Windows Authentication not working on my webserver

i have a weird thing going on. I have configured a website to use windows authentication. Now when i check on a client in a domain or on my domain controller i can access the website after entering my credentials. But on the webserver itself i can't login with these same credentials. Is this normal behaviour or what can cause this to happen ?

Informatica Facebook connection

I have a little problem. I have installed Informatica server on Guest VM that has hostname info-hadoop with bridge network(in mean that other Computers in LAN can see and use it without any extra NAT rules).
On computer that use Informatica server in /etc/hosts was added
IP info-hadoop
To create Facebook connection i followed official manual and this video .
Here i got problem with Valid OAuth redirect URIs. Under
https://info-hadoop:8443/ows
i have such OAuth Callback URL:
https://info-hadoop:8443/ows/jrs/callback
But i can't enter this URL in
https://developers.facebook.com/apps/myappID/settings/advanced/
Facebook doesn't allow to save this URL. So i tried to use such link
https://info-hadoop.com:8443/ows/jrs/callback
With proper added lines on /etc/hosts:
IP info-hadoop info-hadoop.com
But facebook throws exception(in video at 3:30)
Given URL is not allowed by the Application Configuration
What should i do?

Meteor ROOT_URL setting to make accounts-facebook work when behind apache proxy

I'm running meteor on localhost:3000 and I have apache set up to proxy requests for a domain to that meteor instance using a virtualhost and mod_proxy.
I'm getting this error when trying to log in to my meteor app using accounts-facebook:
Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains.
I think this is because my ROOT_URL is http://localhost:3000 . If I change the ROOT_URL to the domain, then of course meteor tries to listen to the domain, but can't because my apache server is in the way.
Is there a way I can make this work without another IP address?
From Meteor documentation,
Ensure that your $ROOT_URL matches the authorized domain and callback
URL that you configure with the external service (for instance, if you
are running Meteor behind a proxy server, $ROOT_URL should be the
externally-accessible URL, not the URL inside your proxy).
In my case, my app is listening on a configured port with mod_proxy behind an Apache proxy server, say it is listening http://www.example.com:8080. I have other applications running on other ports.
To get going, on Facebook I set Site URL and Valid OAuth redirect URIs to http://www.example.com:3000 and App Domains to www.example.com. On my machine I set ROOT_URL to http://www.example.com:3000, which is externally-accessible.
Such configurations work for me without a second IP address.
I could get it working by simply having
# /etc/hosts
127.0.0.1 localhost.localdomain localhost
And the facebook settings as in the image below. I've set a secondary (mobile) url to point to http://localhost:3000
I've created a whole facebook app like this, with login, access to graph-api etc. And everything was working both online and in the dev envrionment

localhost test setup - Facebook not allowing localhost

Been trying to setup my Facebook app which I want to use for Logins to allow me to test it on my Mac's localhost. Facebook is throwing the error "App Domain: http://localhost is not a valid domain." when I try change App Domain of Site URL to localhost or 127.0.0.1
IS there any way to get the facebook login api to redirect the browser to my localhost after authentication?
The way I do it is alias the site I'm working on to something like: http://sitename.loc, and then setup an app used specifically for testing with that as the domain.
An example of how to do this can be found here:
https://stackoverflow.com/a/7493806/1056965
On your local machine you have to setup hosts file to point your site name on local ip address. For example if you have to setup authorization with fb on site example.com put this record in your hosts file
127.0.0.1 example.com
And just start your site localy and facebook oauth will redirect you on example.com and you will get valid token localy.
For setup hosts file on windows help is on this link Windows Hosts Setup
Linux help link Linux hosts
It's simple enough when you find out.
Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.
If your domain is foo.com, then add this line:
127.0.0.1 local.foo.com
When you are testing, open local.foo.com in your browser and it should work.
Allready, explained here
How to Test Facebook Connect Locally