diff options
author | Kyle L. Huff <kyle.huff@curetheitch.com> | 2013-08-25 13:17:01 -0400 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-08-25 22:02:38 +0100 |
commit | 19a05c908f7d8be82de6f69f533317d8a0db49dd (patch) | |
tree | dcc996b81a8153791ac78c64d24363a85a02fa53 /lib/curl_sasl.h | |
parent | bb5529331334e1e1c79ff3320220bba12fc8457d (diff) | |
download | curl-19a05c908f7d8be82de6f69f533317d8a0db49dd.tar.gz |
sasl: added basic SASL XOAUTH2 support
Added the ability to generated a base64 encoded XOAUTH2 token
containing: "user=<username>^Aauth=Bearer <bearer token>^A^A"
as per RFC6749 "OAuth 2.0 Authorization Framework".
Diffstat (limited to 'lib/curl_sasl.h')
-rw-r--r-- | lib/curl_sasl.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/curl_sasl.h b/lib/curl_sasl.h index 22dcf805b..964e94cad 100644 --- a/lib/curl_sasl.h +++ b/lib/curl_sasl.h @@ -32,6 +32,7 @@ #define SASL_MECH_GSSAPI (1 << 4) #define SASL_MECH_EXTERNAL (1 << 5) #define SASL_MECH_NTLM (1 << 6) +#define SASL_MECH_XOAUTH2 (1 << 7) /* Authentication mechanism values */ #define SASL_AUTH_NONE 0 @@ -85,6 +86,13 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, #endif /* USE_NTLM */ +/* This is used to generate a base64 encoded XOAUTH2 authentication message + containing the user name and bearer token */ +CURLcode Curl_sasl_create_xoauth2_message(struct SessionHandle *data, + const char *user, + const char *bearer, + char **outptr, size_t *outlen); + /* This is used to cleanup any libraries or curl modules used by the sasl functions */ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused); |