Mixed Content error because of Keycloak default login redirectionwhy is keycloak removing the SSL in the redirect uri?keycloak apache server configuration with 'Mixed Content' problemsHow to avoid login page of KeyCloak and deploy our customized login page of our project?Keycloak CORS issue when being redirected to loginForce Keycloak redirect to user's host address in dockerKeycloak SSO - too many redirectsKeycloak redirects to login on page refreshSpring security application behind zuul proxy ,using keycloak , login is not redirected properlyKeycloak CORS issue associated with login redirectKeycloak Grails Spring - redirection after login
A Rare Riley Riddle
How did Arya survive the stabbing?
Failed to fetch jessie backports repository
How to pronounce the slash sign
Pole-zeros of a real-valued causal FIR system
Valid Badminton Score?
Would a high gravity rocky planet be guaranteed to have an atmosphere?
Was Spock the First Vulcan in Starfleet?
Can the discrete variable be a negative number?
Do sorcerers' Subtle Spells require a skill check to be unseen?
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
What is the intuitive meaning of having a linear relationship between the logs of two variables?
How can a function with a hole (removable discontinuity) equal a function with no hole?
What happens if you roll doubles 3 times then land on "Go to jail?"
Is oxalic acid dihydrate considered a primary acid standard in analytical chemistry?
How does buying out courses with grant money work?
Escape a backup date in a file name
India just shot down a satellite from the ground. At what altitude range is the resulting debris field?
Opposite of a diet
Customer Requests (Sometimes) Drive Me Bonkers!
Why are there no referendums in the US?
Is a stroke of luck acceptable after a series of unfavorable events?
Arithmetic mean geometric mean inequality unclear
How does the UK government determine the size of a mandate?
Mixed Content error because of Keycloak default login redirection
why is keycloak removing the SSL in the redirect uri?keycloak apache server configuration with 'Mixed Content' problemsHow to avoid login page of KeyCloak and deploy our customized login page of our project?Keycloak CORS issue when being redirected to loginForce Keycloak redirect to user's host address in dockerKeycloak SSO - too many redirectsKeycloak redirects to login on page refreshSpring security application behind zuul proxy ,using keycloak , login is not redirected properlyKeycloak CORS issue associated with login redirectKeycloak Grails Spring - redirection after login
INFORMATION NEEDED:
I use Keycloak (Docker version) behind a Spring project.
(The client side of this project is React and communication between client and backend is provided by REST services.)
The client side is secured and using "https" scheme.
It is my Spring configuration:
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: clientname
public-client: true
THE ROOT OF THE PROBLEM:
When I click a link from client, it calls a Spring service normally.
But before that, it redirects to default login page of Keycloak with adding this path sso/login to the current "https" url but changing scheme to "http".
But, redirecting from https to http create a problem like this:
Mixed Content: The page at 'https://www.helpful.army/contents/Problem' was loaded over HTTPS, but requested an insecure resource 'http://serviceha-helpfularmy.b9ad.pro-us-east-1.openshiftapps.com/sso/login'. This request has been blocked; the content must be served over HTTPS.
spring openshift keycloak
add a comment |
INFORMATION NEEDED:
I use Keycloak (Docker version) behind a Spring project.
(The client side of this project is React and communication between client and backend is provided by REST services.)
The client side is secured and using "https" scheme.
It is my Spring configuration:
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: clientname
public-client: true
THE ROOT OF THE PROBLEM:
When I click a link from client, it calls a Spring service normally.
But before that, it redirects to default login page of Keycloak with adding this path sso/login to the current "https" url but changing scheme to "http".
But, redirecting from https to http create a problem like this:
Mixed Content: The page at 'https://www.helpful.army/contents/Problem' was loaded over HTTPS, but requested an insecure resource 'http://serviceha-helpfularmy.b9ad.pro-us-east-1.openshiftapps.com/sso/login'. This request has been blocked; the content must be served over HTTPS.
spring openshift keycloak
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56
add a comment |
INFORMATION NEEDED:
I use Keycloak (Docker version) behind a Spring project.
(The client side of this project is React and communication between client and backend is provided by REST services.)
The client side is secured and using "https" scheme.
It is my Spring configuration:
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: clientname
public-client: true
THE ROOT OF THE PROBLEM:
When I click a link from client, it calls a Spring service normally.
But before that, it redirects to default login page of Keycloak with adding this path sso/login to the current "https" url but changing scheme to "http".
But, redirecting from https to http create a problem like this:
Mixed Content: The page at 'https://www.helpful.army/contents/Problem' was loaded over HTTPS, but requested an insecure resource 'http://serviceha-helpfularmy.b9ad.pro-us-east-1.openshiftapps.com/sso/login'. This request has been blocked; the content must be served over HTTPS.
spring openshift keycloak
INFORMATION NEEDED:
I use Keycloak (Docker version) behind a Spring project.
(The client side of this project is React and communication between client and backend is provided by REST services.)
The client side is secured and using "https" scheme.
It is my Spring configuration:
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: clientname
public-client: true
THE ROOT OF THE PROBLEM:
When I click a link from client, it calls a Spring service normally.
But before that, it redirects to default login page of Keycloak with adding this path sso/login to the current "https" url but changing scheme to "http".
But, redirecting from https to http create a problem like this:
Mixed Content: The page at 'https://www.helpful.army/contents/Problem' was loaded over HTTPS, but requested an insecure resource 'http://serviceha-helpfularmy.b9ad.pro-us-east-1.openshiftapps.com/sso/login'. This request has been blocked; the content must be served over HTTPS.
spring openshift keycloak
spring openshift keycloak
edited Mar 7 at 15:15
Murat Döner
asked Mar 7 at 13:10
Murat DönerMurat Döner
163
163
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56
add a comment |
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56
add a comment |
1 Answer
1
active
oldest
votes
I have solved this problem and similar ones with these steps:
(1) Frontend side:
You know, www.helpful.army is an educational project which has an interface running on React and it is in NGINX server.
So, I appended the default NGINX server config with mandatory headers:
location /
try_files $uri /index.html;
proxy_set_header X-Forwarded-Proto $scheme;
**add_header Access-Control-Allow-Origin *;**
(2) Backend side:
I have created a different client on Keycloak just for the Spring-Boot backend and set is as a "Bearer-only" one.
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: serviceha
bearer-only: true
ssl-required: "external"
confidential-port: 0
verify-token-audience: true
I also add this configuration for application.yml:
server:
port: 8443
remote_ip_header: x-forwarded-for
protocol_header: x-forwarded-proto
use-forward-headers: true
(3) I have changed all ports from interface to backend as 8443
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044623%2fmixed-content-error-because-of-keycloak-default-login-redirection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have solved this problem and similar ones with these steps:
(1) Frontend side:
You know, www.helpful.army is an educational project which has an interface running on React and it is in NGINX server.
So, I appended the default NGINX server config with mandatory headers:
location /
try_files $uri /index.html;
proxy_set_header X-Forwarded-Proto $scheme;
**add_header Access-Control-Allow-Origin *;**
(2) Backend side:
I have created a different client on Keycloak just for the Spring-Boot backend and set is as a "Bearer-only" one.
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: serviceha
bearer-only: true
ssl-required: "external"
confidential-port: 0
verify-token-audience: true
I also add this configuration for application.yml:
server:
port: 8443
remote_ip_header: x-forwarded-for
protocol_header: x-forwarded-proto
use-forward-headers: true
(3) I have changed all ports from interface to backend as 8443
add a comment |
I have solved this problem and similar ones with these steps:
(1) Frontend side:
You know, www.helpful.army is an educational project which has an interface running on React and it is in NGINX server.
So, I appended the default NGINX server config with mandatory headers:
location /
try_files $uri /index.html;
proxy_set_header X-Forwarded-Proto $scheme;
**add_header Access-Control-Allow-Origin *;**
(2) Backend side:
I have created a different client on Keycloak just for the Spring-Boot backend and set is as a "Bearer-only" one.
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: serviceha
bearer-only: true
ssl-required: "external"
confidential-port: 0
verify-token-audience: true
I also add this configuration for application.yml:
server:
port: 8443
remote_ip_header: x-forwarded-for
protocol_header: x-forwarded-proto
use-forward-headers: true
(3) I have changed all ports from interface to backend as 8443
add a comment |
I have solved this problem and similar ones with these steps:
(1) Frontend side:
You know, www.helpful.army is an educational project which has an interface running on React and it is in NGINX server.
So, I appended the default NGINX server config with mandatory headers:
location /
try_files $uri /index.html;
proxy_set_header X-Forwarded-Proto $scheme;
**add_header Access-Control-Allow-Origin *;**
(2) Backend side:
I have created a different client on Keycloak just for the Spring-Boot backend and set is as a "Bearer-only" one.
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: serviceha
bearer-only: true
ssl-required: "external"
confidential-port: 0
verify-token-audience: true
I also add this configuration for application.yml:
server:
port: 8443
remote_ip_header: x-forwarded-for
protocol_header: x-forwarded-proto
use-forward-headers: true
(3) I have changed all ports from interface to backend as 8443
I have solved this problem and similar ones with these steps:
(1) Frontend side:
You know, www.helpful.army is an educational project which has an interface running on React and it is in NGINX server.
So, I appended the default NGINX server config with mandatory headers:
location /
try_files $uri /index.html;
proxy_set_header X-Forwarded-Proto $scheme;
**add_header Access-Control-Allow-Origin *;**
(2) Backend side:
I have created a different client on Keycloak just for the Spring-Boot backend and set is as a "Bearer-only" one.
keycloak:
auth-server-url: https://sso-ssoha.b9ad.pro-us-east-1.openshiftapps.com/auth
realm: master
resource: serviceha
bearer-only: true
ssl-required: "external"
confidential-port: 0
verify-token-audience: true
I also add this configuration for application.yml:
server:
port: 8443
remote_ip_header: x-forwarded-for
protocol_header: x-forwarded-proto
use-forward-headers: true
(3) I have changed all ports from interface to backend as 8443
answered Mar 8 at 11:35
Murat DönerMurat Döner
163
163
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044623%2fmixed-content-error-because-of-keycloak-default-login-redirection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have reverse proxy on the way to Keycloak? Does it set X-Forwarded-Proto correctly? We've got problem with that, but I can't remember what error did we get then and if your case can be similar...
– 9ilsdx 9rvj 0lo
Mar 7 at 16:32
I think you have a point. Because, client side is React running on NGINX with a default server config is like this: events worker_connections 1024; http include /etc/nginx/mime.types; server listen 3000; server_name www.helpful.army; root /usr/share/nginx/html; location / try_files $uri /index.html; location ~ .css add_header Content-Type text/css; location ~ .js add_header Content-Type application/x-javascript;
– Murat Döner
Mar 7 at 19:21
Oke 9ilsdx, I have solved it with your help. Wrote the solution. Thanks.
– Murat Döner
Mar 8 at 11:56