author | Joseph Smarr <joseph@plaxo.com> | 2009-12-22 20:44:48 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2009-12-22 20:44:48 (UTC) |
commit | 142ca30cad85769067419a9ed5b60501af67e17c (patch) (unidiff) | |
tree | 6f5b49fb31d105be8052cf6f47336f0fa6141a64 /include/opkele/oauth_ext.h | |
parent | bd4c671f0a842309d17eb4579847b6fd1169ce5f (diff) | |
download | libopkele-142ca30cad85769067419a9ed5b60501af67e17c.zip libopkele-142ca30cad85769067419a9ed5b60501af67e17c.tar.gz libopkele-142ca30cad85769067419a9ed5b60501af67e17c.tar.bz2 |
put Joseph's files into repository
Thanks to Joseph Smarr (now) of Plaxo for contributing these extensions!
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/oauth_ext.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/opkele/oauth_ext.h b/include/opkele/oauth_ext.h new file mode 100644 index 0000000..37a826b --- a/dev/null +++ b/include/opkele/oauth_ext.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef __OPKELE_OAUTH_EXT_H | ||
2 | #define __OPKELE_OAUTH_EXT_H | ||
3 | |||
4 | /** | ||
5 | * @file | ||
6 | * @brief OAuth extension | ||
7 | */ | ||
8 | |||
9 | #include <opkele/extension.h> | ||
10 | |||
11 | namespace opkele { | ||
12 | |||
13 | /** | ||
14 | * OpenID OAuth extension | ||
15 | * http://step2.googlecode.com/svn/spec/openid_oauth_extension/latest/openid_oauth_extension.html | ||
16 | */ | ||
17 | class oauth_ext_t : public extension_t { | ||
18 | public: | ||
19 | std::string m_consumer, m_scope, m_request_token; | ||
20 | |||
21 | /** | ||
22 | * Consumer constructor. | ||
23 | * @param fr required fields | ||
24 | * @see fields_required | ||
25 | * @param fo optional fields | ||
26 | * @see fields_optional | ||
27 | * @param pu policy url | ||
28 | * @see policy_url | ||
29 | */ | ||
30 | oauth_ext_t(const char *consumer = "", const char *scope = "") : m_consumer(consumer), m_scope(scope) { } | ||
31 | |||
32 | virtual void rp_checkid_hook(basic_openid_message& om); | ||
33 | virtual void rp_id_res_hook(const basic_openid_message& om, | ||
34 | const basic_openid_message& sp); | ||
35 | virtual void op_checkid_hook(const basic_openid_message& inm); | ||
36 | virtual void op_id_res_hook(basic_openid_message& oum); | ||
37 | |||
38 | virtual void checkid_hook(basic_openid_message& om); | ||
39 | virtual void id_res_hook(const basic_openid_message& om, | ||
40 | const basic_openid_message& sp); | ||
41 | virtual void checkid_hook(const basic_openid_message& inm, | ||
42 | basic_openid_message& oum); | ||
43 | |||
44 | /** | ||
45 | * Function called after parsing sreg request to set up response | ||
46 | * fields. The default implementation tries to send as much fields | ||
47 | * as we have. The function is supposed to set the data and | ||
48 | * fields_response. | ||
49 | * @see fields_response | ||
50 | * @param inm incoming openid message | ||
51 | * @param oum outgoing openid message | ||
52 | */ | ||
53 | virtual void setup_response(const basic_openid_message& inm, | ||
54 | basic_openid_message& oum); | ||
55 | |||
56 | virtual void setup_response(); | ||
57 | |||
58 | }; | ||
59 | } | ||
60 | |||
61 | #endif /* __OPKELE_OAUTH_EXT_H */ | ||
62 | |||