1 from consumer import OpenIdAbstractAuthConsumer
2 from forum.authentication.base import ConsumerTemplateContext
4 class GoogleAuthConsumer(OpenIdAbstractAuthConsumer):
5 def get_user_url(self, request):
6 return 'https://www.google.com/accounts/o8/id'
8 class GoogleAuthContext(ConsumerTemplateContext):
13 icon = '/media/images/openid/google.gif'
17 class YahooAuthConsumer(OpenIdAbstractAuthConsumer):
18 def get_user_url(self, request):
19 return 'http://yahoo.com/'
21 class YahooAuthContext(ConsumerTemplateContext):
26 icon = '/media/images/openid/yahoo.gif'
30 class AolAuthConsumer(OpenIdAbstractAuthConsumer):
31 def get_user_url(self, request):
32 uname = request.POST['input_field']
33 return 'http://openid.aol.com/' + uname
35 class AolAuthContext(ConsumerTemplateContext):
38 simple_form_context = {
39 'your_what': 'AOL screen name'
43 icon = '/media/images/openid/aol.png'
46 class MyOpenIdAuthConsumer(OpenIdAbstractAuthConsumer):
48 #'username': ('http://schema.openid.net/namePerson/friendly', 'friendly'),
49 'email': 'http://schema.openid.net/contact/email',
50 #'web': 'http://schema.openid.net/contact/web/default',
51 #'birthdate': ('http://schema.openid.net/birthDate', 'birthDate'),
54 def get_user_url(self, request):
55 blog_name = request.POST['input_field']
56 return "http://%s.myopenid.com/" % blog_name
58 class MyOpenIdAuthContext(ConsumerTemplateContext):
61 simple_form_context = {
62 'your_what': 'MyOpenID user name'
65 human_name = 'MyOpenID'
66 icon = '/media/images/openid/myopenid_big.png'
69 class FlickrAuthConsumer(OpenIdAbstractAuthConsumer):
70 def get_user_url(self, request):
71 blog_name = request.POST['input_field']
72 return "http://flickr.com/%s/" % blog_name
74 class FlickrAuthContext(ConsumerTemplateContext):
77 simple_form_context = {
78 'your_what': 'Flickr user name'
82 icon = '/media/images/openid/flickr.png'
85 class TechnoratiAuthConsumer(OpenIdAbstractAuthConsumer):
86 def get_user_url(self, request):
87 blog_name = request.POST['input_field']
88 return "http://technorati.com/people/technorati/%s/" % blog_name
90 class TechnoratiAuthContext(ConsumerTemplateContext):
93 simple_form_context = {
94 'your_what': 'Technorati user name'
97 human_name = 'Technorati'
98 icon = '/media/images/openid/technorati.png'
101 class WordpressAuthConsumer(OpenIdAbstractAuthConsumer):
102 def get_user_url(self, request):
103 blog_name = request.POST['input_field']
104 return "http://%s.wordpress.com/" % blog_name
106 class WordpressAuthContext(ConsumerTemplateContext):
109 simple_form_context = {
110 'your_what': 'Wordpress blog name'
113 human_name = 'Wordpress'
114 icon = '/media/images/openid/wordpress.png'
117 class BloggerAuthConsumer(OpenIdAbstractAuthConsumer):
118 def get_user_url(self, request):
119 blog_name = request.POST['input_field']
120 return "http://%s.blogspot.com/" % blog_name
122 class BloggerAuthContext(ConsumerTemplateContext):
125 simple_form_context = {
126 'your_what': 'Blogger blog name'
129 human_name = 'Blogger'
130 icon = '/media/images/openid/blogger.png'
133 class LiveJournalAuthConsumer(OpenIdAbstractAuthConsumer):
134 def get_user_url(self, request):
135 blog_name = request.POST['input_field']
136 return "http://%s.livejournal.com/" % blog_name
138 class LiveJournalAuthContext(ConsumerTemplateContext):
141 simple_form_context = {
142 'your_what': 'LiveJournal blog name'
145 human_name = 'LiveJournal'
146 icon = '/media/images/openid/livejournal.png'
149 class ClaimIdAuthConsumer(OpenIdAbstractAuthConsumer):
150 def get_user_url(self, request):
151 blog_name = request.POST['input_field']
152 return "http://claimid.com/%s" % blog_name
154 class ClaimIdAuthContext(ConsumerTemplateContext):
157 simple_form_context = {
158 'your_what': 'ClaimID user name'
161 human_name = 'ClaimID'
162 icon = '/media/images/openid/claimid.png'
164 class VerisignAuthConsumer(OpenIdAbstractAuthConsumer):
165 def get_user_url(self, request):
166 blog_name = request.POST['input_field']
167 return "http://%s.pip.verisignlabs.com/" % blog_name
169 class VerisignAuthContext(ConsumerTemplateContext):
172 simple_form_context = {
173 'your_what': 'Verisign user name'
176 human_name = 'Verisign'
177 icon = '/media/images/openid/verisign.png'
180 class OpenIdUrlAuthConsumer(OpenIdAbstractAuthConsumer):
183 class OpenIdUrlAuthContext(ConsumerTemplateContext):
186 human_name = 'OpenId url'
187 stack_item_template = 'modules/openidauth/openidurl.html'
188 icon = '/media/images/openid/openid-inputicon.gif'