1 package fr.paris.lutece.plugins.mylutece.modules.openid.service;
2
3 import fr.paris.lutece.plugins.mylutece.authentication.MultiLuteceAuthentication;
4 import fr.paris.lutece.plugins.mylutece.modules.openid.authentication.OpenIDAuthentication;
5 import fr.paris.lutece.portal.service.spring.SpringContextService;
6 import fr.paris.lutece.portal.service.util.AppLogService;
7
8
9
10
11
12 public final class OpenIDService
13 {
14 private static final OpenIDService _singleton = new OpenIDService( );
15 private static final String AUTHENTICATION_BEAN_NAME = "mylutece-openid.authentication";
16
17
18
19
20
21 private OpenIDService( )
22 {
23
24 }
25
26
27
28
29
30 public static OpenIDService getInstance( )
31 {
32 return _singleton;
33 }
34
35
36
37
38
39 public void init( )
40 {
41 OpenIDAuthentication authentication = ( OpenIDAuthentication ) SpringContextService.getPluginBean( OpenIDPlugin.PLUGIN_NAME,
42 AUTHENTICATION_BEAN_NAME );
43 if ( authentication != null )
44 {
45 MultiLuteceAuthentication.registerAuthentication( authentication );
46 }
47 else
48 {
49 AppLogService.error( "OpenIDAuthentication not found, please check your openid_context.xml configuration" );
50 }
51
52 }
53 }