]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-oauth2: Remove typ check
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 8 May 2023 05:23:39 +0000 (08:23 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Aug 2023 07:08:45 +0000 (07:08 +0000)
It is not really useful. And mostly just keeps breaking when people
invent new kty values.

src/lib-oauth2/oauth2-jwt.c

index 6631f21c7a3cc31fcfc71bdd92c27442ea95ed28..d4006f974b10ac1b5ebeee4fe729c096d073f317 100644 (file)
@@ -322,15 +322,9 @@ static int
 oauth2_jwt_header_process(struct json_tree *tree, const char **alg_r,
                          const char **kid_r, const char **error_r)
 {
-       const char *typ = get_field(tree, "typ");
        const char *alg = get_field(tree, "alg");
        const char *kid = get_field(tree, "kid");
 
-       if (typ != NULL && strcasecmp(typ, "JWT") != 0) {
-               *error_r = t_strdup_printf("Unsupported typ value '%s'", typ);
-               return -1;
-       }
-
        if (alg == NULL) {
                *error_r = "Cannot find 'alg' field";
                return -1;
@@ -413,7 +407,7 @@ oauth2_jwt_body_process(const struct oauth2_settings *set, const char *alg,
                }
        }
 
-       const char *aud = get_field(tree, "aud", NULL);
+       const char *aud = get_field(tree, "aud");
        /* if there is client_id configured, then aud should be present */
        if (set->client_id != NULL && *set->client_id != '\0') {
                if (aud == NULL) {