Modify

Opened 17 years ago

Closed 17 years ago

#2305 closed enhancement (fixed)

Add support for directed identity in OpenID 2.0

Reported by: martin@… Owned by: Dalius
Priority: normal Component: AuthOpenIdPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

There could be a config option for the openid plugin, where one could configure the OpenID provider to use. This might be useful in scenarios where a known (company wide) OpenID provider should be used for many projects or if the user would like to provide 'one click' usability for login.

Something like

[authopenid]
default_identifier = https://openid.ee

and the link 'Log in with OpenID' would automatically start the flow that is similar to currently entering openid.ee to the identifier box and clicking 'log in'

My own interest of course is to use openid.ee with this feature, so a patch might come soon :)

Attachments (0)

Change History (2)

comment:1 Changed 17 years ago by anonymous

Here's a quick patch to do exactly this:

Index: authopenid/authopenid.py
===================================================================
--- authopenid/authopenid.py	(revision 2892)
+++ authopenid/authopenid.py	(working copy)
@@ -55,6 +55,9 @@
          authentication (''since 0.9'').""")
     check_ip_mask = Option('trac', 'check_auth_ip_mask', '255.255.255.0',
             """What mask should be applied to user address.""")
+    
+    default_openid = Option('trac', 'default_openid', None,
+            """Default OpenID provider for directed identity.""")
 
     def _get_masked_address(self, address):
         mask = struct.unpack('>L', socket.inet_aton(self.check_ip_mask))[0]
@@ -144,6 +147,9 @@
             return self._do_logout(req)
 
     def _do_login(self, req):
+        if self.default_openid:
+           req.args['openid_identifier'] = self.default_openid
+           return self._do_verify(req)
         add_stylesheet(req, 'authopenid/css/openid.css')
         return 'openidlogin.html', {
             'action': req.href.openidverify(),

to configure, use

[trac]
default_openid = https://openid.ee

clicking the "OpenID Login" in the navbar initiates a directed identity login with https://openid.ee Tested and works as expected.

comment:2 Changed 17 years ago by Dalius

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dalius.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.