From: Aki Tuomi Date: Tue, 21 Feb 2017 09:21:19 +0000 (+0200) Subject: auth: Make tokeninfo optional X-Git-Tag: 2.3.0.rc1~2038 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a986052e4117b17ce5262fd17d5f129d6c110a1;p=thirdparty%2Fdovecot%2Fcore.git auth: Make tokeninfo optional It is not supported by all OAuth2 solutions --- diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index c66dcdfa34..fb45709d37 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -603,7 +603,12 @@ void db_oauth2_lookup(struct db_oauth2 *db, struct db_oauth2_request *req, input.real_remote_port = req->auth_request->real_remote_port; input.service = req->auth_request->service; - req->req = oauth2_token_validation_start(&db->oauth2_set, &input, - db_oauth2_lookup_continue, req); + if (*db->oauth2_set.tokeninfo_url == '\0') { + req->req = oauth2_introspection_start(&req->db->oauth2_set, &input, + db_oauth2_introspect_continue, req); + } else { + req->req = oauth2_token_validation_start(&db->oauth2_set, &input, + db_oauth2_lookup_continue, req); + } DLLIST_PREPEND(&db->head, req); }