diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php
index 6993605..2854be0 100644
--- a/src/Controller/RedirectController.php
+++ b/src/Controller/RedirectController.php
@@ -54,10 +54,10 @@ class RedirectController extends ControllerBase implements AccessInterface {
    * {@inheritdoc}
    */
   public function __construct(
-      OpenIDConnectClientManager $plugin_manager,
-      RequestStack $request_stack,
-      LoggerChannelFactoryInterface $logger_factory,
-      AccountInterface $current_user
+    OpenIDConnectClientManager $plugin_manager,
+    RequestStack $request_stack,
+    LoggerChannelFactoryInterface $logger_factory,
+    AccountInterface $current_user
   ) {
 
     $this->pluginManager = $plugin_manager;
@@ -113,10 +113,16 @@ class RedirectController extends ControllerBase implements AccessInterface {
 
     // Get parameters from the session, and then clean up.
     $parameters = [
-      'destination' => 'user',
+      'destination' => [
+        'path' => 'user',
+        'options' => [
+          'query' => [],
+        ],
+      ],
       'op' => 'login',
       'connect_uid' => NULL,
     ];
+
     foreach ($parameters as $key => $default) {
       if (isset($_SESSION['openid_connect_' . $key])) {
         $parameters[$key] = $_SESSION['openid_connect_' . $key];
@@ -158,7 +164,8 @@ class RedirectController extends ControllerBase implements AccessInterface {
           '@details' => $query->get('error_description') ? $query->get('error_description') : $this->t('Unknown error.'),
         ];
         $message = 'Authorization failed: @error. Details: @details';
-        $this->loggerFactory->get('openid_connect_' . $client_name)->error($message, $variables);
+        $this->loggerFactory->get('openid_connect_' . $client_name)
+          ->error($message, $variables);
         drupal_set_message(t('Could not authenticate with @provider.', $provider_param), 'error');
       }
     }
@@ -186,13 +193,47 @@ class RedirectController extends ControllerBase implements AccessInterface {
       }
     }
 
+    // Support destination query parameter and ensure no /user/login redirect.
+    if ($destination['path'] == '/user/login') {
+      $destination['path'] = 'user';
+
+      // Use the "destination" query parameter if one is set.
+      if (isset($destination['options']['query']['destination'])) {
+
+        $destination_parts = [];
+        if ($destination['options']['query']['destination']) {
+          $destination_parts = UrlHelper::parse($destination['options']['query']['destination']);
+        }
+
+        $empty_path = empty($destination_parts['path']);
+        if ($empty_path || $destination_parts['path'] != 'user/login') {
+          $destination = [
+            // Empty destination query parameter means the front page, ie. '/'.
+            'path' => (!$empty_path) ? $destination_parts['path'] : '',
+            'options' => [
+              'query' => [],
+            ],
+          ];
+          // Include the query options if any. For example from a views' filters.
+          if (!empty($destination_parts['query'])) {
+            $destination['options']['query'] = $destination_parts['query'];
+          }
+          // Include the fragment ... not likely unless the options are altered.
+          if (!empty($destination_parts['fragment'])) {
+            $destination['options']['fragment'] = $destination_parts['fragment'];
+          }
+        }
+      }
+    }
+
     // It's possible to set 'options' in the redirect destination.
     if (is_array($destination)) {
-      $query = !empty($destination[1]['query']) ? '?' . $destination[1]['query'] : '';
-      $redirect = Url::fromUri('internal:/' . ltrim($destination[0], '/') . $query)->toString();
+      $redirect = Url::fromUri('internal:/' . ltrim($destination['path'], '/'), $destination['options'])
+        ->toString();
     }
     else {
-      $redirect = Url::fromUri('internal:/' . ltrim($destination, '/'))->toString();
+      $redirect = Url::fromUri('internal:/' . ltrim($destination, '/'))
+        ->toString();
     }
     return new RedirectResponse($redirect);
   }
