Closed philiplb closed 2 years ago
I resolved it :) Root cause was that the application is behind a load balancer and so setting the trusted proxies middleware solved it:
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string|null
*/
protected $proxies = '*';
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
Hi, I have a problem here with the redirection to the guarded page after logging in: So the Keycloak login page is called, I log in there, Keycloak redirects to https://.../callback. All fine and good so far. But this callback URL is then redirecting to the HTTP homepage which is wrong, I need it to redirect to the HTTPS URL.
My attempts so far:
https://...
Providers/AppServiceProvider::boot
containsURL::forceScheme('https');
Is there anything else I can do here?