View Javadoc
1   /*
2    * Copyright (c) 2002-2017, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication;
35  
36  import fr.paris.lutece.plugins.mylutece.authentication.PortalAuthentication;
37  import fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication.business.OpenIdDatabaseHome;
38  import fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication.business.OpenIdDatabaseUser;
39  import fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication.business.OpenIdDatabaseUserHome;
40  import fr.paris.lutece.plugins.mylutece.modules.openiddatabase.authentication.web.MyLuteceOpenIdDatabaseApp;
41  import fr.paris.lutece.plugins.mylutece.modules.openiddatabase.service.OpenIDDatabasePlugin;
42  import fr.paris.lutece.portal.service.i18n.I18nService;
43  import fr.paris.lutece.portal.service.plugin.Plugin;
44  import fr.paris.lutece.portal.service.plugin.PluginService;
45  import fr.paris.lutece.portal.service.security.LoginRedirectException;
46  import fr.paris.lutece.portal.service.security.LuteceUser;
47  import fr.paris.lutece.portal.service.security.SecurityService;
48  import fr.paris.lutece.portal.service.util.AppLogService;
49  import fr.paris.lutece.portal.service.util.AppPathService;
50  import fr.paris.lutece.portal.service.util.AppPropertiesService;
51  import fr.paris.lutece.util.url.UrlItem;
52  
53  import org.apache.log4j.Logger;
54  
55  import org.openid4java.OpenIDException;
56  
57  import org.openid4java.consumer.ConsumerException;
58  import org.openid4java.consumer.ConsumerManager;
59  import org.openid4java.consumer.InMemoryConsumerAssociationStore;
60  import org.openid4java.consumer.InMemoryNonceVerifier;
61  import org.openid4java.consumer.VerificationResult;
62  
63  import org.openid4java.discovery.DiscoveryInformation;
64  import org.openid4java.discovery.Identifier;
65  
66  import org.openid4java.message.AuthRequest;
67  import org.openid4java.message.AuthSuccess;
68  import org.openid4java.message.MessageExtension;
69  import org.openid4java.message.ParameterList;
70  import org.openid4java.message.ax.StoreResponse;
71  import org.openid4java.message.sreg.SRegMessage;
72  import org.openid4java.message.sreg.SRegRequest;
73  import org.openid4java.message.sreg.SRegResponse;
74  
75  
76  import org.openid4java.util.HttpClientFactory;
77  import org.openid4java.util.ProxyProperties;
78  
79  import java.util.ArrayList;
80  import java.util.Collection;
81  import java.util.HashSet;
82  import java.util.List;
83  import java.util.Locale;
84  import java.util.Set;
85  
86  import javax.security.auth.login.LoginException;
87  
88  import javax.servlet.http.HttpServletRequest;
89  
90  
91  /**
92   * The Class provides an implementation of the inherited abstract class PortalAuthentication based on
93   * a database.
94   *
95   * @author Mairie de Paris
96   * @version 2.0.0
97   *
98   * @since Lutece v2.0.0
99   */
100 public class BaseAuthentication extends PortalAuthentication
101 {
102     ////////////////////////////////////////////////////////////////////////////////////////////////
103     // Constants
104     private static final String AUTH_SERVICE_NAME = AppPropertiesService.getProperty( "mylutece-openiddatabase.service.name" );
105 
106     // Messages properties
107     private static final String PROPERTY_MESSAGE_USER_NOT_FOUND_DATABASE = "module.mylutece.database.message.userNotFoundDatabase";
108     private static final String PLUGIN_NAME = "mylutece-openiddatabase";
109     private static final String URL_CALLBACK = "jsp/site/plugins/mylutece/modules/openiddatabase/OpenIdDatabaseProviderCallBack.jsp";
110     private static final String CONSTANT_PATH_ICON = "images/local/skin/plugins/mylutece/modules/openiddatabase/mylutece-openid.png";
111     private static final String MESSAGE_KEY_AUTHENTICATION_FAILED = "module.mylutece.openid.authenticationFailed";
112     private static ConsumerManager _manager;
113     private static Logger _logger = Logger.getLogger( "openid" );
114 
115     //Properties
116     private static final String PROPERTY_PROXY_PASSWORD = "openiddatabase.proxyPassword";
117     private static final String PROPERTY_PROXY_HOST_NAME = "openiddatabase.proxyHostName";
118     private static final String PROPERTY_PROXY_PORT_NUMBER = "openiddatabase.proxyPort";
119     private static final String PROPERTY_PROXY_DOMAIN_NAME = "openiddatabase.domainName";
120     private static final String PROPERTY_PROXY_USER_NAME = "openiddatabase.proxyUserName";
121 
122     // Parameters
123     public static final String PARAMETER_PAGE = "page";
124     public static final String PARAMETER_XPAGE_VALUE = "myluteceopeniddatabase";
125     public static final String PARAMETER_ERROR = "error";
126     private static final String PARAMETER_LOGIN = "login";
127     private static final String PARAMETER_LAST_NAME = "last_name";
128     private static final String PARAMETER_FIRST_NAME = "first_name";
129     private static final String PARAMETER_EMAIL = "email";
130 
131     /**
132      * Constructor
133      *
134      */
135     public BaseAuthentication(  )
136     {
137         super(  );
138 
139         // instantiate a ConsumerManager object
140         if ( _manager == null )
141         {
142             try
143             {
144                 _manager = new ConsumerManager(  );
145             }
146             catch ( ConsumerException e )
147             {
148                 AppLogService.error( "Error instantiating OpenID ConsumerManager : " + e.getMessage(  ), e );
149             }
150         }
151     }
152 
153     /**
154      * Gets the Authentification service name
155      * @return The name of the authentication service
156      */
157     public String getAuthServiceName(  )
158     {
159         return AUTH_SERVICE_NAME;
160     }
161 
162     /**
163      * Gets the Authentification type
164      * @param request The HTTP request
165      * @return The type of authentication
166      */
167     public String getAuthType( HttpServletRequest request )
168     {
169         return HttpServletRequest.BASIC_AUTH;
170     }
171 
172     /**
173      * This methods checks the login info in the database
174      *
175      * @param strUserName The username
176      * @param strUserPassword The password
177      * @param request The HttpServletRequest
178      *
179      * @return A LuteceUser object corresponding to the login
180      * @throws LoginException The LoginException
181      */
182     public LuteceUser login( String strUserName, String strUserPassword, HttpServletRequest request )
183         throws LoginException, LoginRedirectException
184     {
185         if ( strUserPassword.equals( "dummy" ) )
186         {
187             return loginOpenId( strUserName, request );
188         }
189         else
190         {
191             return loginDatabase( strUserName, strUserPassword, request );
192         }
193     }
194 
195     public LuteceUser loginOpenId( String strUserName, HttpServletRequest request )
196         throws LoginException, LoginRedirectException
197     {
198         String strRedirectUrl = getProviderRedirectUrl( request, strUserName );
199 
200         if ( strRedirectUrl != null )
201         {
202             throw new LoginRedirectException( strRedirectUrl );
203         }
204 
205         return null;
206     }
207 
208     public LuteceUser loginDatabase( String strUserName, String strUserPassword, HttpServletRequest request )
209         throws LoginException, LoginRedirectException
210     {
211         Locale locale = request.getLocale(  );
212         Plugin plugin = PluginService.getPlugin( PLUGIN_NAME );
213 
214         BaseUser user = OpenIdDatabaseHome.findLuteceUserByLogin( strUserName, plugin, this );
215 
216         //Unable to find the user
217         if ( user == null )
218         {
219             AppLogService.info( "Unable to find user in the database : " + strUserName );
220             throw new LoginException( I18nService.getLocalizedString( PROPERTY_MESSAGE_USER_NOT_FOUND_DATABASE, locale ) );
221         }
222 
223         //Check password
224         if ( !OpenIdDatabaseUserHome.checkPassword( strUserName, strUserPassword, plugin ) )
225         {
226             AppLogService.info( "User login : Incorrect login or password" + strUserName );
227             throw new LoginException( I18nService.getLocalizedString( PROPERTY_MESSAGE_USER_NOT_FOUND_DATABASE, locale ) );
228         }
229 
230         //Get roles
231         ArrayList<String> arrayRoles = OpenIdDatabaseHome.findUserRolesFromLogin( strUserName, plugin );
232 
233         if ( !arrayRoles.isEmpty(  ) )
234         {
235             user.setRoles( arrayRoles );
236         }
237 
238         //Get groups
239         ArrayList<String> arrayGroups = OpenIdDatabaseHome.findUserGroupsFromLogin( strUserName, plugin );
240 
241         if ( !arrayGroups.isEmpty(  ) )
242         {
243             user.setGroups( arrayGroups );
244         }
245 
246         return user;
247     }
248 
249     /**
250      * This methods logout the user
251      * @param user The user
252      */
253     public void logout( LuteceUser user )
254     {
255     }
256 
257     /**
258      * This method returns an anonymous Lutece user
259      *
260      * @return An anonymous Lutece user
261      */
262     public LuteceUser getAnonymousUser(  )
263     {
264         return new BaseUser( LuteceUser.ANONYMOUS_USERNAME, this );
265     }
266 
267     /**
268      * Checks that the current user is associated to a given role
269      * @param user The user
270      * @param request The HTTP request
271      * @param strRole The role name
272      * @return Returns true if the user is associated to the role, otherwise false
273      */
274     public boolean isUserInRole( LuteceUser user, HttpServletRequest request, String strRole )
275     {
276         String[] roles = setAllRoles( user );
277 
278         if ( ( roles != null ) && ( strRole != null ) )
279         {
280             for ( String role : roles )
281             {
282                 if ( strRole.equals( role ) )
283                 {
284                     return true;
285                 }
286             }
287         }
288 
289         return false;
290     }
291 
292     /**
293      * Returns the View account page URL of the Authentication Service
294      * @return The URL
295      */
296     public String getViewAccountPageUrl(  )
297     {
298         return MyLuteceOpenIdDatabaseApp.getViewAccountUrl(  );
299     }
300 
301     /**
302      * Returns the New account page URL of the Authentication Service
303      * @return The URL
304      */
305     public String getNewAccountPageUrl(  )
306     {
307         return MyLuteceOpenIdDatabaseApp.getNewAccountUrl(  );
308     }
309 
310     /**
311      * Returns the Change password page URL of the Authentication Service
312      * @return The URL
313      */
314     public String getChangePasswordPageUrl(  )
315     {
316         return MyLuteceOpenIdDatabaseApp.getChangePasswordUrl(  );
317     }
318 
319     /**
320      * Returns the lost password URL of the Authentication Service
321      * @return The URL
322      */
323     public String getLostPasswordPageUrl(  )
324     {
325         return MyLuteceOpenIdDatabaseApp.getLostPasswordUrl(  );
326     }
327 
328     /**
329      * set all roles for this user :
330      *    - user's roles
331      *    - user's groups roles
332      *
333      * @param user The user
334      * @return Array of roles
335      */
336     private String[] setAllRoles( LuteceUser user )
337     {
338         Set<String> setRoles = new HashSet<String>(  );
339         String[] strGroups = user.getGroups(  );
340         String[] strRoles = user.getRoles(  );
341 
342         if ( strRoles != null )
343         {
344             for ( String strRole : strRoles )
345             {
346                 setRoles.add( strRole );
347             }
348         }
349 
350         String[] strReturnRoles = new String[setRoles.size(  )];
351         setRoles.toArray( strReturnRoles );
352 
353         return strReturnRoles;
354     }
355 
356     /**
357      * Returns all users managed by the authentication service if this feature is
358      * available.
359      * @return A collection of Lutece users or null if the service doesn't provide a users list
360      */
361     public Collection<LuteceUser> getUsers(  )
362     {
363         Plugin plugin = PluginService.getPlugin( PLUGIN_NAME );
364 
365         Collection<BaseUser> BaseUsers = OpenIdDatabaseHome.findDatabaseUsersList( plugin, this );
366         Collection<LuteceUser> luteceUsers = new ArrayList<LuteceUser>(  );
367 
368         for ( BaseUser user : BaseUsers )
369         {
370             luteceUsers.add( user );
371         }
372 
373         return luteceUsers;
374     }
375 
376     /**
377      * Returns the user managed by the authentication service if this feature is
378      * available.
379      * @return A Lutece users or null if the service doesn't provide a user
380      */
381     public LuteceUser getUser( String userLogin )
382     {
383         Plugin plugin = PluginService.getPlugin( PLUGIN_NAME );
384 
385         BaseUser user = OpenIdDatabaseHome.findLuteceUserByLogin( userLogin, plugin, this );
386 
387         return user;
388     }
389 
390     /**
391      * Build the http request to send to the provider to validate the authentication
392      * @param request The HTTP request
393      * @param strOpenID The user OpenID URL
394      * @return The URL
395      */
396     private String getProviderRedirectUrl( HttpServletRequest request, String strOpenID )
397     {
398         String strReturnUrl = getMessageUrl( request, MESSAGE_KEY_AUTHENTICATION_FAILED );
399         String strProxyHostName = AppPropertiesService.getProperty( PROPERTY_PROXY_HOST_NAME );
400 
401         //Proxy connection can be anonymous
402         if ( ( strProxyHostName != null ) && !strProxyHostName.equals( "" ) )
403         {
404             ProxyProperties proxyProps = new ProxyProperties(  );
405             String strDomain = AppPropertiesService.getProperty( PROPERTY_PROXY_DOMAIN_NAME );
406             int strProxyPort = Integer.parseInt( AppPropertiesService.getProperty( PROPERTY_PROXY_PORT_NUMBER ) );
407             String strUserName = AppPropertiesService.getProperty( PROPERTY_PROXY_USER_NAME );
408             String strPassword = AppPropertiesService.getProperty( PROPERTY_PROXY_PASSWORD );
409 
410             proxyProps.setProxyHostName( strProxyHostName );
411             proxyProps.setProxyPort( strProxyPort );
412             proxyProps.setDomain( strDomain );
413             proxyProps.setUserName( strUserName );
414             proxyProps.setPassword( strPassword );
415 
416             HttpClientFactory.setProxyProperties( proxyProps );
417         }
418 
419         try
420         {
421             _manager = new ConsumerManager(  );
422             _manager.setAssociations( new InMemoryConsumerAssociationStore(  ) );
423             _manager.setNonceVerifier( new InMemoryNonceVerifier( 5000 ) );
424 
425             // perform discovery on the user-supplied identifier
426             List discoveries = _manager.discover( strOpenID.trim(  ) );
427 
428             // attempt to associate with the OpenID provider
429             // and retrieve one service endpoint for authentication
430             DiscoveryInformation discovered = _manager.associate( discoveries );
431 
432             // store the discovery information in the user's session
433             request.getSession(  ).setAttribute( "openid-disc", discovered );
434 
435             // obtain a AuthRequest message to be sent to the OpenID provider
436 
437             // Attribute Exchange example: fetching the 'email' attribute
438             SRegRequest fetch = SRegRequest.createFetchRequest(  );
439             fetch.addAttribute( "fullname", true );
440             fetch.addAttribute( "nickname", true );
441             fetch.addAttribute( "email", true );
442 
443             //  fetch.addAttribute( ATTRIBUTE_FIRST_NAME, "http://schema.openid.net/namePerson/first", true );
444             // fetch.addAttribute( ATTRIBUTE_LAST_NAME, "http://schema.openid.net/namePerson/last", true );
445             // fetch.addAttribute( ATTRIBUTE_EMAIL, "http://schema.openid.net/contact/email", true );
446             AuthRequest authReq = _manager.authenticate( discovered, getReturnUrl( request ) );
447 
448             // attach the extension to the authentication request
449             authReq.addExtension( fetch );
450 
451             strReturnUrl = authReq.getDestinationUrl( true );
452         }
453         catch ( OpenIDException e )
454         {
455             _logger.error( "OpenId Error building authentication request : " + e.getMessage(  ), e );
456         }
457 
458         return strReturnUrl;
459     }
460 
461     /**
462      * The response URL that will be used by the provider to give its response :
463      * authentication validated or not. If OK the response will hold uesr's attributes.
464      * @param request The HTTP request
465      * @return The URL
466      */
467     private String getReturnUrl( HttpServletRequest request )
468     {
469         _logger.debug( "Callback URL : " + AppPathService.getBaseUrl( request ) + URL_CALLBACK );
470 
471         return AppPathService.getBaseUrl( request ) + URL_CALLBACK;
472     }
473 
474     /**
475      * Build the URL to display a message
476      * @param request The HTTP request
477      * @param strMessageKey The message key
478      * @return The URL to display the message
479      */
480     private String getMessageUrl( HttpServletRequest request, String strMessageKey )
481     {
482         UrlItem url = new UrlItem( AppPathService.getBaseUrl( request ) + AppPathService.getPortalUrl(  ) );
483         url.addParameter( PARAMETER_PAGE, PARAMETER_XPAGE_VALUE );
484         url.addParameter( PARAMETER_ERROR, strMessageKey );
485 
486         return url.getUrl(  );
487     }
488 
489     /**
490      * processing the authentication response
491      * @param request The HTTP request
492      * @return The URL depending of the result
493      * @throws IncompleteUserDetailsException
494      * @throws FirstConnectionException
495      */
496     public String verifyResponse( HttpServletRequest request )
497     {
498         String strReturnUrl = getMessageUrl( request, MESSAGE_KEY_AUTHENTICATION_FAILED );
499 
500         _logger.debug( "Provider callback - host : " + request.getRemoteHost(  ) + " - IP : " +
501             request.getRemoteAddr(  ) );
502 
503         BaseUser user = null;
504 
505         try
506         {
507             // extract the parameters from the authentication response
508             // (which comes in as a HTTP request from the OpenID provider)
509             ParameterList response = new ParameterList( request.getParameterMap(  ) );
510 
511             // retrieve the previously stored discovery information
512             DiscoveryInformation discovered = (DiscoveryInformation) request.getSession(  ).getAttribute( "openid-disc" );
513 
514             // extract the receiving URL from the HTTP request
515             StringBuffer receivingURL = request.getRequestURL(  );
516             String queryString = request.getQueryString(  );
517 
518             if ( ( queryString != null ) && ( queryString.length(  ) > 0 ) )
519             {
520                 receivingURL.append( "?" ).append( request.getQueryString(  ) );
521             }
522 
523             // verify the response; ConsumerManager needs to be the same
524             // (static) instance used to place the authentication request
525             VerificationResult verification = _manager.verify( receivingURL.toString(  ), response, discovered );
526 
527             // examine the verification result and extract the verified identifier
528             Identifier verified = verification.getVerifiedId(  );
529             _logger.debug( "Authentication verification  : " + verified );
530 
531             if ( verified != null )
532             {
533                 user = new BaseUser( verified.getIdentifier(  ), this );
534 
535                 AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse(  );
536 
537                 if ( authSuccess.hasExtension( SRegMessage.OPENID_NS_SREG ) )
538                 {
539                     _logger.debug( "Authentication successfull - identifier : " + verified.getIdentifier(  ) );
540 
541                     MessageExtension ext = authSuccess.getExtension( SRegMessage.OPENID_NS_SREG );
542 
543                     if ( ext instanceof SRegResponse )
544                     {
545                         /*      for ( String strKey : (Set<String>) ext.getAttributes(  ).keySet(  ) ) {
546                                   _logger.debug( "Attribute " + strKey + " - value : " +
547                                           ext.getAttributes(  ).get( strKey ) );
548                               }*/
549                         SRegResponse sregResp = (SRegResponse) ext;
550 
551                         String strFirstName = (String) sregResp.getAttributeValue( "fullname" );
552                         String strLastName = (String) sregResp.getAttributeValue( "nickname" );
553 
554                         //List emails = sregResp.getAttributeValue(  ATTRIBUTE_EMAIL );
555                         //String email = (String) emails.get( 0 );
556                         String strEmail = sregResp.getAttributeValue( "email" );
557 
558                         user.setUserInfo( LuteceUser.NAME_GIVEN, strFirstName );
559                         user.setUserInfo( LuteceUser.NAME_FAMILY, strLastName );
560                         user.setUserInfo( LuteceUser.BUSINESS_INFO_ONLINE_EMAIL, strEmail );
561 
562                         Plugin plugin = PluginService.getPlugin( PLUGIN_NAME );
563                         OpenIdDatabaseUser databaseUser = new OpenIdDatabaseUser(  );
564                         databaseUser.setEmail( strEmail );
565                         databaseUser.setFirstName( strFirstName );
566                         databaseUser.setLastName( strLastName );
567                         databaseUser.setLogin( verified.getIdentifier(  ) );
568                         databaseUser.setAuthentificationType( "openid" );
569                         strReturnUrl = AppPathService.getBaseUrl( request ) + AppPathService.getPortalUrl(  ); // success
570 
571                         //if login does not exist
572                         if ( !OpenIdDatabaseUserHome.checkUserLogin( verified.getIdentifier(  ), plugin ) )
573                         {
574                             OpenIdDatabaseUserHome.create( databaseUser, "", plugin ); //User is created 
575 
576                             if ( databaseUser.isValid(  ) ) //Verify whether all attributes are filled 
577                             {
578                                 SecurityService.getInstance(  ).registerUser( request, user );
579                             }
580                             else
581                             {
582                                 strReturnUrl = getUserDetailsUrl( request, databaseUser );
583                             }
584                         }
585                         else
586                         {
587                             SecurityService.getInstance(  ).registerUser( request, user );
588 
589                             if ( databaseUser.isValid(  ) ) //Verify whether all attributes are filled 
590                             {
591                                 OpenIdDatabaseUserHome.updateByLogin( databaseUser, plugin );
592                             }
593                             else
594                             {
595                                 strReturnUrl = getUserDetailsUrl( request, databaseUser );
596                             }
597                         }
598 
599                         //if the id of the openid is present in database delete
600                         //update the user data in the database
601                     }
602                     else if ( ext instanceof StoreResponse )
603                     {
604                     }
605                 }
606             }
607         }
608         catch ( OpenIDException e )
609         {
610             _logger.error( "OpenId Error in provider response : " + e.getMessage(  ), e );
611         }
612 
613         return strReturnUrl;
614     }
615 
616     /**
617      * Build the URL to display the user details when a needed field is empty
618      * @param request The HTTP request
619      * @param user The user object
620      * @return The URL to display the message
621      */
622     private String getUserDetailsUrl( HttpServletRequest request, OpenIdDatabaseUser user )
623     {
624         UrlItem url = new UrlItem( AppPathService.getBaseUrl( request ) + AppPathService.getPortalUrl(  ) );
625         url.addParameter( PARAMETER_PAGE, PARAMETER_XPAGE_VALUE );
626         url.addParameter( "action", "detailsOpenId" ); //TODO clean
627         url.addParameter( PARAMETER_LOGIN, user.getLogin(  ) );
628         url.addParameter( PARAMETER_FIRST_NAME, user.getFirstName(  ) );
629         url.addParameter( PARAMETER_LAST_NAME, user.getLastName(  ) );
630         url.addParameter( PARAMETER_EMAIL, user.getEmail(  ) );
631 
632         return url.getUrl(  );
633     }
634 
635     /**
636      * 
637      *{@inheritDoc}
638      */
639 	public String getIconUrl()
640 	{
641 		return CONSTANT_PATH_ICON;
642 	}
643 
644 	/**
645 	 * 
646 	 *{@inheritDoc}
647 	 */
648 	public String getName()
649 	{
650 		return OpenIDDatabasePlugin.PLUGIN_NAME;
651 	}
652 
653 	/**
654 	 * 
655 	 *{@inheritDoc}
656 	 */
657 	public String getPluginName()
658 	{
659 		return OpenIDDatabasePlugin.PLUGIN_NAME;
660 	}
661 }