Skip to content
Snippets Groups Projects
Unverified Commit 00a6fca7 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Fix example + type

parent ad1184b2
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,8 @@ To begin with, we will create a very simple authentication source, where the use ...@@ -40,6 +40,8 @@ To begin with, we will create a very simple authentication source, where the use
Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following contents: Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following contents:
<?php <?php
namespace SimpleSAML\Module\mymodule\Auth\Source;
class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase { class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase {
protected function login($username, $password) { protected function login($username, $password) {
if ($username !== 'theusername' || $password !== 'thepassword') { if ($username !== 'theusername' || $password !== 'thepassword') {
...@@ -58,7 +60,7 @@ Some things to note: ...@@ -58,7 +60,7 @@ Some things to note:
- The classname is `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth`. - The classname is `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth`.
This tells SimpleSAMLphp to look for the class in `modules/mymodule/lib/Auth/Source/MyAuth.php`. This tells SimpleSAMLphp to look for the class in `modules/mymodule/lib/Auth/Source/MyAuth.php`.
- Our authentication source subclassese `\SimpleSAML\Module\core\Auth\UserPassBase`. - Our authentication source subclasses `\SimpleSAML\Module\core\Auth\UserPassBase`.
This is a helper-class that implements much of the common code needed for username/password authentication. This is a helper-class that implements much of the common code needed for username/password authentication.
- The `login` function receives the username and password the user enters. - The `login` function receives the username and password the user enters.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment