]> git.openstreetmap.org Git - osqa.git/blob - forum_modules/openidauth/authentication.py
Remove support for Google OpenID logins
[osqa.git] / forum_modules / openidauth / authentication.py
1 from consumer import OpenIdAbstractAuthConsumer
2 from forum.authentication.base import ConsumerTemplateContext
3
4 class YahooAuthConsumer(OpenIdAbstractAuthConsumer):
5     def get_user_url(self, request):
6         return 'http://me.yahoo.com/'
7
8 class YahooAuthContext(ConsumerTemplateContext):
9     mode = 'BIGICON'
10     type = 'DIRECT'
11     weight = 300
12     human_name = 'Yahoo'
13     icon = '/media/images/openid/yahoo.gif'
14
15
16
17 class AolAuthConsumer(OpenIdAbstractAuthConsumer):
18     def get_user_url(self, request):
19         uname = request.POST['input_field']
20         return 'http://openid.aol.com/' + uname
21
22 class AolAuthContext(ConsumerTemplateContext):
23     mode = 'SMALLICON'
24     type = 'SIMPLE_FORM'
25     simple_form_context = {
26         'your_what': 'AOL screen name'
27     }
28     weight = 200
29     human_name = 'AOL'
30     icon = '/media/images/openid/aol.png'
31
32
33 class MyOpenIdAuthConsumer(OpenIdAbstractAuthConsumer):
34     dataype2ax_schema = {
35         #'username': ('http://schema.openid.net/namePerson/friendly', 'friendly'),
36         'email': 'http://schema.openid.net/contact/email',
37         #'web': 'http://schema.openid.net/contact/web/default',
38         #'birthdate': ('http://schema.openid.net/birthDate', 'birthDate'),
39     }
40
41     def get_user_url(self, request):
42         blog_name = request.POST['input_field']
43         return "http://%s.myopenid.com/" % blog_name
44
45 class MyOpenIdAuthContext(ConsumerTemplateContext):
46     mode = 'BIGICON'
47     type = 'SIMPLE_FORM'
48     simple_form_context = {
49         'your_what': 'MyOpenID user name'
50     }
51     weight = 400
52     human_name = 'MyOpenID'
53     icon = '/media/images/openid/myopenid_big.png'
54
55
56 class FlickrAuthConsumer(OpenIdAbstractAuthConsumer):
57     def get_user_url(self, request):
58         blog_name = request.POST['input_field']
59         return "http://flickr.com/%s/" % blog_name
60
61 class FlickrAuthContext(ConsumerTemplateContext):
62     mode = 'SMALLICON'
63     type = 'SIMPLE_FORM'
64     simple_form_context = {
65         'your_what': 'Flickr user name'
66     }
67     weight = 250
68     human_name = 'Flickr'
69     icon = '/media/images/openid/flickr.png'
70
71
72 class TechnoratiAuthConsumer(OpenIdAbstractAuthConsumer):
73     def get_user_url(self, request):
74         blog_name = request.POST['input_field']
75         return "http://technorati.com/people/technorati/%s/" % blog_name
76
77 class TechnoratiAuthContext(ConsumerTemplateContext):
78     mode = 'SMALLICON'
79     type = 'SIMPLE_FORM'
80     simple_form_context = {
81         'your_what': 'Technorati user name'
82     }
83     weight = 260
84     human_name = 'Technorati'
85     icon = '/media/images/openid/technorati.png'
86
87
88 class WordpressAuthConsumer(OpenIdAbstractAuthConsumer):
89     def get_user_url(self, request):
90         blog_name = request.POST['input_field']
91         return "http://%s.wordpress.com/" % blog_name
92
93 class WordpressAuthContext(ConsumerTemplateContext):
94     mode = 'SMALLICON'
95     type = 'SIMPLE_FORM'
96     simple_form_context = {
97         'your_what': 'Wordpress blog name'
98     }
99     weight = 270
100     human_name = 'Wordpress'
101     icon = '/media/images/openid/wordpress.png'
102
103
104 class BloggerAuthConsumer(OpenIdAbstractAuthConsumer):
105     def get_user_url(self, request):
106         blog_name = request.POST['input_field']
107         return "http://%s.blogspot.com/" % blog_name
108
109 class BloggerAuthContext(ConsumerTemplateContext):
110     mode = 'SMALLICON'
111     type = 'SIMPLE_FORM'
112     simple_form_context = {
113         'your_what': 'Blogger blog name'
114     }
115     weight = 300
116     human_name = 'Blogger'
117     icon = '/media/images/openid/blogger.png'
118
119
120 class LiveJournalAuthConsumer(OpenIdAbstractAuthConsumer):
121     def get_user_url(self, request):
122         blog_name = request.POST['input_field']
123         return "http://%s.livejournal.com/" % blog_name
124
125 class LiveJournalAuthContext(ConsumerTemplateContext):
126     mode = 'SMALLICON'
127     type = 'SIMPLE_FORM'
128     simple_form_context = {
129         'your_what': 'LiveJournal blog name'
130     }
131     weight = 310
132     human_name = 'LiveJournal'
133     icon = '/media/images/openid/livejournal.png'
134
135
136 class ClaimIdAuthConsumer(OpenIdAbstractAuthConsumer):
137     def get_user_url(self, request):
138         blog_name = request.POST['input_field']
139         return "http://claimid.com/%s" % blog_name
140
141 class ClaimIdAuthContext(ConsumerTemplateContext):
142     mode = 'SMALLICON'
143     type = 'SIMPLE_FORM'
144     simple_form_context = {
145         'your_what': 'ClaimID user name'
146     }
147     weight = 320
148     human_name = 'ClaimID'
149     icon = '/media/images/openid/claimid.png'
150
151 class VerisignAuthConsumer(OpenIdAbstractAuthConsumer):
152     def get_user_url(self, request):
153         blog_name = request.POST['input_field']
154         return "http://%s.pip.verisignlabs.com/" % blog_name
155
156 class VerisignAuthContext(ConsumerTemplateContext):
157     mode = 'SMALLICON'
158     type = 'SIMPLE_FORM'
159     simple_form_context = {
160         'your_what': 'Verisign user name'
161     }
162     weight = 340
163     human_name = 'Verisign'
164     icon = '/media/images/openid/verisign.png'
165
166     
167 class OpenIdUrlAuthConsumer(OpenIdAbstractAuthConsumer):
168     pass
169
170 class OpenIdUrlAuthContext(ConsumerTemplateContext):
171     mode = 'STACK_ITEM'
172     weight = 300
173     human_name = 'OpenId url'
174     stack_item_template = 'modules/openidauth/openidurl.html'
175     icon = '/media/images/openid/openid-inputicon.gif'