#382 show openidc clients on homepage
Opened a year ago by vitoshalabs. Modified a year ago
vitoshalabs/ipsilon add_openidc_clients_to_homepage  into  master

@@ -82,6 +82,10 @@ 

          super(Client, self).__init__()

          if client_info is None:

              client_info = {}

+         elif 'client_name' in client_info:

+             self.name=client_info['client_name']

+             if 'visible' in client_info:

+                 self.visible=str(client_info['visible'])

          self.client_info = client_info

          self.readonly = self.client_info.get('type', 'new') == 'dynamic'

          if 'ipsilon_internal' in client_info:
@@ -380,6 +384,10 @@ 

                  'Default Authentication Context Class requested by client.',

                  self.get_current_info('default_acr_values'),

                  readonly=self.readonly),

+ 	        pconfig.Condition(

+                 'Visible',

+                 'This client is visible in the Portal.',

+                 self.get_current_info('visible')),

              # TODO:

              # id_token_encrypted_response_alg

              # id_token_encrypted_response_enc

@@ -248,6 +248,14 @@ 

          self.extensions.enable(self._config['enabled extensions'].get_value(),

                                 self)

  

+     def get_providers(self):

+         from ipsilon.providers.openidc.provider import Client

+         all_clients=self.admin.clients

+         ret_all_clients=[]

+         for client in all_clients:

+             cl=Client(all_clients[client])

+             ret_all_clients.append(cl)

+         return ret_all_clients

  

  class Installer(ProviderInstaller):

  

file modified
+21 -1
@@ -90,7 +90,7 @@ 

  

        <div class="row thumbnails providers" id="providers">

        {% for p in providers %}

-         {% if (p.visible == '1') or (p.visible == 'True') %}

+         {% if ( (p.visible == '1') or (p.visible == 'True') ) and p.__repr__().startswith('<ipsilon.providers.saml2.provider.ServiceProvider object at ') %}

          <div class="col-sm-4 col-md-3 provider">

            <a

               {% if p.splink or 0 %}
@@ -109,6 +109,26 @@ 

              {% endif %}

            </a>

          </div>

+ 	{% elif p.visible == 'True' and p.__repr__().startswith('<ipsilon.providers.openidc.provider.Client object at ') %}

+         <div class="col-sm-4 col-md-3 provider">

+           <a

+              {% if p.client_info.initiate_login_uri and p.client_info.initiate_login_uri!='' %}

+ 	     href="{{ p.client_info.initiate_login_uri }}"

+              {% else %}

+                href="#"

+              {% endif %}

+              class="thumbnail" data-toggle="tooltip" data-placement="top" title="{{ p.description }}" name="{{ p.name }}">

+             {% if p.imageurl or 0 %}

+               <img src="{{ p.imageurl }}" height=100 width=200>

+             {% else %}

+               <span class="name">

+                 <span class="name-icon">{{ p.name[0] }}</span>

+                 {{ p.name }}

+               </span>

+             {% endif %}

+           </a>

+         </div>

+ 

          {% endif %}

        {% endfor %}

  

Can you provide a screenshot of what this looks like?

Can you provide a screenshot of what this looks like?
Here is a link to it:
Ipsilon homepage screenshot

sorry could not find better way to attach image