changeset 21648:66802cc05f4d

auth: Make sure tokeninfo or introspection URL is given
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Tue, 21 Feb 2017 11:52:59 +0200
parents cbecd2e16979
children 78f38a28086e
files src/auth/db-oauth2.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/db-oauth2.c	Tue Feb 21 11:21:19 2017 +0200
+++ b/src/auth/db-oauth2.c	Tue Feb 21 11:52:59 2017 +0200
@@ -194,6 +194,9 @@
 	http_set.dns_client_socket_path = "dns-client";
 	http_set.user_agent = "dovecot-oauth2-passdb/" DOVECOT_VERSION;
 
+	if (*db->set.tokeninfo_url == '\0' && *db->set.introspection_url == '\0')
+		i_fatal("oauth2: Tokeninfo or introspection URL must be given");
+
 	if (*db->set.rawlog_dir != '\0')
 		http_set.rawlog_dir = db->set.rawlog_dir;