int userlen; /* Username:password length */
+ /*
+ * Only allow Basic if enabled...
+ */
+
+ if (type != CUPSD_AUTH_BASIC)
+ {
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Basic authentication is not enabled.");
+ return;
+ }
+
authorization += 5;
while (isspace(*authorization & 255))
authorization ++;
* Validate the username and password...
*/
- if (type == CUPSD_AUTH_BASIC)
{
#if HAVE_LIBPAM
/*
*name, // Real name
*email; // Email address
+ /*
+ * Only allow OAuth if enabled...
+ */
+
+ if (type != CUPSD_AUTH_BEARER)
+ {
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "OAuth authentication is not enabled.");
+ return;
+ }
+
// Skip whitespace after "Bearer"...
authorization += 7;
while (isspace(*authorization & 255))
/* Output token for username */
gss_name_t client_name; /* Client name */
+ /*
+ * Only allow Kerberos if enabled...
+ */
+
+ if (type != CUPSD_AUTH_NEGOTIATE)
+ {
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Kerberos authentication is not enabled.");
+ return;
+ }
+
# ifdef __APPLE__DISABLED // Remove DISABLED if ever this code is used for macOS installer
/*
* If the weak-linked GSSAPI/Kerberos library is not present, don't try