revert
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 27 Sep 2018 22:17:58 +0000 (00:17 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 27 Sep 2018 22:17:58 +0000 (00:17 +0200)
src/rest-plugins/plugin_rest_openid_connect.c

index 500ecec11f5898c598477d41903fa10bb2d4e6b5..6456458a6875f955b1386a6d96d6c4de7462f61d 100644 (file)
 /**
  * OIDC cookie header information key
  */
-#define OIDC_AUTHORIZATION_HEADER_KEY "Authorization"
+#define OIDC_AUTHORIZATION_HEADER_KEY "authorization"
 
 /**
  * OIDC cookie header information key
@@ -1381,6 +1381,7 @@ check_authorization (struct RequestHandle *handle,
   if (0 != strcmp ("Basic", credentials))
   {
     handle->emsg=GNUNET_strdup("invalid_client");
+    handle->edesc = GNUNET_strdup ("1");
     handle->response_code = MHD_HTTP_UNAUTHORIZED;
     return GNUNET_SYSERR;
   }
@@ -1388,6 +1389,7 @@ check_authorization (struct RequestHandle *handle,
   if (NULL == credentials)
   {
     handle->emsg=GNUNET_strdup("invalid_client");
+    handle->edesc = GNUNET_strdup ("2");
     handle->response_code = MHD_HTTP_UNAUTHORIZED;
     return GNUNET_SYSERR;
   }
@@ -1406,6 +1408,7 @@ check_authorization (struct RequestHandle *handle,
   {
     GNUNET_free_non_null(basic_authorization);
     handle->emsg=GNUNET_strdup("invalid_client");
+    handle->edesc = GNUNET_strdup ("Wrong username");
     handle->response_code = MHD_HTTP_UNAUTHORIZED;
     return GNUNET_SYSERR;
   }
@@ -1414,6 +1417,7 @@ check_authorization (struct RequestHandle *handle,
   {
     GNUNET_free_non_null(basic_authorization);
     handle->emsg=GNUNET_strdup("invalid_client");
+    handle->edesc = GNUNET_strdup (client_id);
     handle->response_code = MHD_HTTP_UNAUTHORIZED;
     return GNUNET_SYSERR;
   }
@@ -1427,6 +1431,7 @@ check_authorization (struct RequestHandle *handle,
     {
       GNUNET_free_non_null(basic_authorization);
       GNUNET_free(expected_pass);
+      handle->edesc = GNUNET_strdup (pass);
       handle->emsg=GNUNET_strdup("invalid_client");
       handle->response_code = MHD_HTTP_UNAUTHORIZED;
       return GNUNET_SYSERR;