How to customize multiauth authentication

20 views
Skip to first unread message

Umar Draz

unread,
Oct 23, 2018, 8:48:33 AM10/23/18
to SimpleSAMLphp developers
I have successfully installed Simplesaml and also verified implementing and successfully integrate with my sites.

Here is my authsource configuration for multiauth


'example-multi' => array(
   
'multiauth:MultiAuth',
   
'sources' => array(
       
'example-sql' => array(
           
'text' => array(
               
'en' => 'Log in with internal database'
           
)
       
),
       
'linkedin' => array(
           
'text' => array(
               
'en' => 'Log in with LinkedIn'
           
)
       
),
       
'facebook' => array(
           
'text' => array(
               
'en' => 'Log in with Facebook'
           
)
       
)
   
),
),


On the multiath login page three buttons are appear

Login in with internal database
Login in with Linkedin
Login in with Facebook

Now I want this multiauth page should have username and password form of example-sql on the same page instead of I click on the first button. For this purpose I had modifed selectsource.php file and added a new form but that is not working.. Here is my code


<?php
$this
->data['header'] = $this->t('{multiauth:multiauth:select_source_header}');
$this
->includeAtTemplateBase('includes/header.php');
?>


<h2><?php echo $this->t('{multiauth:multiauth:select_source_header}'); ?></h2>
<p><?php echo $this->t('{multiauth:multiauth:select_source_text}'); ?></p>


<form action="
<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="get">
<input type="hidden" name="AuthState" value="
<?php echo htmlspecialchars($this->data['authstate']); ?>" />
<ul>
<?php
foreach($this->data['sources'] as $source) {
        echo
'<li class="' . htmlspecialchars($source['css_class']) . ' authsource">';
       
if ($source['source'] === $this->data['preferred']) {
                $autofocus
= ' autofocus="autofocus"';
       
} else {
                $autofocus
= '';
       
}
        $name
= 'src-' . base64_encode($source['source']);
        echo
'<input type="submit" name="' . htmlspecialchars($name) . '"' . $autofocus . ' ' .
               
'id="button-' . htmlspecialchars($source['source']) . '" ' .
               
'value="' . htmlspecialchars($this->t($source['text'])) . '" />';
        echo
'</li>';
}
?>
</ul>
</form>


<form action="?" method="post" name="f" class="form-horizontal">
<input id="username" name="username"
<?php echo ($this->data['forceUsername']) ? 'disabled="disabled"' : ''; ?> placeholder="your email" class="form-control" required="true" value="" type="text" <?php if (!$this->data['forceUsername']) { echo 'tabindex="1"';} ?> value="<?php echo htmlspecialchars($this->data['username']); ?>">
<input id="password" name="password" placeholder="your password" class="form-control" required="true" value="" type="password">
<input type="hidden" name="AuthState" value="
<?php echo htmlspecialchars($this->data['authstate']); ?>" />
</form>


<?php $this->includeAtTemplateBase('includes/footer.php');


Would you please help me how I can achieve this?

Labu Das

unread,
Oct 23, 2018, 11:14:26 AM10/23/18
to simplesa...@googlegroups.com
Hi Umar,

This is looks like some good information, but I wonder what made you to send me. I never posted a question on any site on this topic.
Thanks

--
You received this message because you are subscribed to the Google Groups "SimpleSAMLphp developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplesamlphp-...@googlegroups.com.
To post to this group, send email to simplesa...@googlegroups.com.
Visit this group at https://groups.google.com/group/simplesamlphp-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages