From 6a986052e4117b17ce5262fd17d5f129d6c110a1 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 21 Feb 2017 11:21:19 +0200 Subject: [PATCH] auth: Make tokeninfo optional It is not supported by all OAuth2 solutions --- src/auth/db-oauth2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); } -- 2.47.3