summaryrefslogtreecommitdiffabout
path: root/include/opkele/oauth_ext.h
Unidiff
Diffstat (limited to 'include/opkele/oauth_ext.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/oauth_ext.h62
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
11namespace 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