auth-request-handler-private.h \
auth-request-var-expand.h \
auth-sasl.h \
+ auth-sasl-oauth2.h \
auth-settings.h \
auth-fields.h \
auth-token.h \
#include "auth-common.h"
#include "auth-sasl.h"
+#include "auth-sasl-oauth2.h"
#include "auth-request.h"
static void
mech_oauth2_verify_token_input_args, oauth2_req);
}
}
+
+void mech_oauth2_initialize(void)
+{
+ const char *mech, *error;
+ array_foreach_elem(&global_auth_settings->mechanisms, mech) {
+ if (strcasecmp(mech, mech_xoauth2.mech_name) == 0 ||
+ strcasecmp(mech, mech_oauthbearer.mech_name) == 0) {
+ if (db_oauth2_init(auth_event, FALSE,
+ &db_oauth2, &error) < 0)
+ i_fatal("Cannot initialize oauth2: %s", error);
+ }
+ }
+}
--- /dev/null
+#ifndef AUTH_SASL_OAUTH2_H
+#define AUTH_SASL_OAUTH2_H
+
+void mech_oauth2_initialize(void);
+
+#endif
#include "auth-master-connection.h"
#include "auth-client-connection.h"
#include "auth-policy.h"
+#include "auth-sasl-oauth2.h"
#include "db-oauth2.h"
#include <unistd.h>
dict_drivers_register_builtin();
mech_init(global_auth_settings);
+ mech_oauth2_initialize();
mech_reg = mech_register_init(global_auth_settings);
auths_preinit(NULL, global_auth_settings, mech_reg, protocols);
#endif
mech_register_module(&mech_oauthbearer);
mech_register_module(&mech_xoauth2);
- mech_oauth2_initialize();
}
void mech_deinit(const struct auth_settings *set)
.auth_initial = sasl_server_mech_generic_auth_initial,
.auth_continue = mech_xoauth2_auth_continue,
};
-
-void mech_oauth2_initialize(void)
-{
- const char *mech, *error;
- array_foreach_elem(&global_auth_settings->mechanisms, mech) {
- if (strcasecmp(mech, mech_xoauth2.mech_name) == 0 ||
- strcasecmp(mech, mech_oauthbearer.mech_name) == 0) {
- if (db_oauth2_init(auth_event, FALSE,
- &db_oauth2, &error) < 0)
- i_fatal("Cannot initialize oauth2: %s", error);
- }
- }
-}
void mech_init(const struct auth_settings *set);
void mech_deinit(const struct auth_settings *set);
-void mech_oauth2_initialize(void);
-
/*
* Request
*/