Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MFA client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
MFA client
Commits
159c673e
Commit
159c673e
authored
1 month ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update readme
parent
2ed7ed25
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+6
-91
6 additions, 91 deletions
README.md
with
6 additions
and
91 deletions
README.md
+
6
−
91
View file @
159c673e
...
@@ -2,96 +2,11 @@
...
@@ -2,96 +2,11 @@
PHP class to enable multi factor authentication for a webapp.
PHP class to enable multi factor authentication for a webapp.
Related projects:
👤 Author: Axel Hahn; Institute for Medical Education; University of Bern
📄 Source:
<https://git-repo.iml.unibe.ch/iml-open-source/mfa-client>
📜 License: GNU GPL 3.0
📗 Docs:
<https://os-docs.iml.unibe.ch/mfa-client/>
(TODO - see docs folder so far)
*
MFA server 🌐
<https://git-repo.iml.unibe.ch/iml-open-source/mfa-server>
**Related projects**
:
## Reqirements
*
PHP 8 (up to PHP 8.4)
*
PHP application with a simple user based protection eg. basic authentication.
*
A running Mfa server instance
## Installation
### Get source
Go to the web application vendor directory.
Clone this repository.
```
txt
git clone <repo url>
```
### Configuration
The files in the subdir
`src`
:
```
txt
cd mfa-client/src
```
Copy mfaconfig.php.dist to mfaconfig.php.
Open the mfa server admin and create a new web app. You get an id and a secret for your aplication.
In the config enter the url of api, id and secret.
```
php
<?php
return
[
"api"
=>
"https://mfa.example.com/api/"
,
*
MFA server 🌐
<https://git-repo.iml.unibe.ch/iml-open-source/mfa-server>
"appid"
=>
"c1cabd22fbdb698861ad08b27de7399a"
,
"shared_secret"
=>
"p9wjjXSewZq0VkM1t5Sm3ZbI4ATEVetU"
,
"debug"
=>
false
,
];
```
## Enable MFA
### Activate MFA after logon
This step depends on your code. You need to find a good place to embed the MFA process.
```
php
<?php
...
// enable MFA:
include
"<APPROOT>/vendor/mfa-client/src/mfa-ensure.php"
;
...
```
### Give access to user settings on mfa server
If a user is logged in and solves a mfa challenge then he jumps back to theapplication.
You should offer a link to the user that jumps to the mfa server to edit his own settings there.
A good place is the user profile page in your app.
**📌 Example**
:
```
php
<?php
...
// load class
require
"<APPROOT>/vendor/mfa-client/mfaclient.class.php"
;
// initialize client
$oMfa
=
new
mfaclient
();
// $oMfa->debug(true);
// set the user
$oMfa
->
setUser
(
$this
->
getUserid
());
// show a button; set a complete url where to jump back
echo
$oMfa
->
getButtonSetup
(
"<button>MFA settings</button>"
,
"https://myapp.example.com/profile"
);
...
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment