Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dokuwiki OAuth Plugin
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
uffd
Dokuwiki OAuth Plugin
Commits
b5d24594
Commit
b5d24594
authored
Nov 3, 2020
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Added Uffd service
parent
8c4b6783
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
classes/UffdAdapter.php
+45
-0
45 additions, 0 deletions
classes/UffdAdapter.php
conf/default.php
+5
-0
5 additions, 0 deletions
conf/default.php
conf/metadata.php
+6
-0
6 additions, 0 deletions
conf/metadata.php
lang/en/settings.php
+5
-0
5 additions, 0 deletions
lang/en/settings.php
with
61 additions
and
0 deletions
classes/UffdAdapter.php
0 → 100644
+
45
−
0
View file @
b5d24594
<?php
namespace
OAuth\Plugin
;
/**
* Class UffdAdapter
*
* @link https://git.cccv.de/infra/uffd/uffd
* @package OAuth\Plugin
*/
class
UffdAdapter
extends
AbstractAdapter
{
/**
* Retrieve the user's data
*
* The array needs to contain at least 'user', 'mail', 'name' and optional 'grps'
*
* @return array
*/
public
function
getUser
()
{
$JSON
=
new
\JSON
(
JSON_LOOSE_TYPE
);
$data
=
array
();
/** var OAuth\OAuth2\Service\Generic $this->oAuth */
$result
=
$JSON
->
decode
(
$this
->
oAuth
->
request
(
$this
->
hlp
->
getUserInfoEndpoint
(
'Uffd'
)));
$data
[
'user'
]
=
$result
[
'nickname'
];
$data
[
'name'
]
=
$result
[
'name'
];
$data
[
'mail'
]
=
$result
[
'email'
];
//$data['grps'] = $result['groups'];
return
$data
;
}
/**
* We make use of the "Generic" oAuth 2 Service as defined in
* phpoauthlib/src/OAuth/OAuth2/Service/Generic.php
*
* @return string
*/
public
function
getServiceName
()
{
return
'Generic'
;
}
}
This diff is collapsed.
Click to expand it.
conf/default.php
+
5
−
0
View file @
b5d24594
...
...
@@ -28,6 +28,11 @@ $conf['doorkeeper-key'] = '';
$conf
[
'doorkeeper-secret'
]
=
''
;
$conf
[
'doorkeeper-authurl'
]
=
'https://doorkeeper-provider.herokuapp.com/oauth/authorize'
;
$conf
[
'doorkeeper-tokenurl'
]
=
'https://doorkeeper-provider.herokuapp.com/oauth/token'
;
$conf
[
'uffd-key'
]
=
''
;
$conf
[
'uffd-secret'
]
=
''
;
$conf
[
'uffd-authurl'
]
=
'https://uffd.example.com/oauth2/authorize'
;
$conf
[
'uffd-tokenurl'
]
=
'https://uffd.example.com/oauth2/token'
;
$conf
[
'uffd-userinfourl'
]
=
'https://uffd.example.com/oauth2/userinfo'
;
$conf
[
'mailRestriction'
]
=
''
;
$conf
[
'singleService'
]
=
''
;
$conf
[
'register-on-auth'
]
=
0
;
This diff is collapsed.
Click to expand it.
conf/metadata.php
+
6
−
0
View file @
b5d24594
...
...
@@ -49,6 +49,11 @@ $meta['doorkeeper-key'] = array('string');
$meta
[
'doorkeeper-secret'
]
=
array
(
'string'
);
$meta
[
'doorkeeper-authurl'
]
=
array
(
'string'
);
$meta
[
'doorkeeper-tokenurl'
]
=
array
(
'string'
);
$meta
[
'uffd-key'
]
=
array
(
'string'
);
$meta
[
'uffd-secret'
]
=
array
(
'string'
);
$meta
[
'uffd-authurl'
]
=
array
(
'string'
);
$meta
[
'uffd-tokenurl'
]
=
array
(
'string'
);
$meta
[
'uffd-userinfourl'
]
=
array
(
'string'
);
$meta
[
'mailRestriction'
]
=
array
(
'string'
,
'_pattern'
=>
'!^(@[^,@]+(\.[^,@]+)+(,|$))*$!'
);
// https://regex101.com/r/mG4aL5/3
$meta
[
'singleService'
]
=
array
(
'multichoice'
,
'_choices'
=>
array
(
...
...
@@ -60,5 +65,6 @@ $meta['singleService'] = array('multichoice',
'Github'
,
'Yahoo'
,
'Doorkeeper'
,
'Uffd'
,
'Keycloak'
));
$meta
[
'register-on-auth'
]
=
array
(
'onoff'
,
'_caution'
=>
'security'
);
This diff is collapsed.
Click to expand it.
lang/en/settings.php
+
5
−
0
View file @
b5d24594
...
...
@@ -31,6 +31,11 @@ $lang['doorkeeper-key'] = '(Example) The Application ID of your registered
$lang
[
'doorkeeper-secret'
]
=
'(Example) The Secret of your registered Doorkeeper Application.'
;
$lang
[
'doorkeeper-authurl'
]
=
'(Example) The authorization endpoint URL of your Doorkeeper setup.'
;
$lang
[
'doorkeeper-tokenurl'
]
=
'(Example) The access token endpoint URL of your Doorkeeper setup.'
;
$lang
[
'uffd-key'
]
=
'The app id registered in uffd.'
;
$lang
[
'uffd-secret'
]
=
'The app secret registered in uffd.'
;
$lang
[
'uffd-authurl'
]
=
'The authorization endpoint URL of your uffd setup.'
;
$lang
[
'uffd-tokenurl'
]
=
'The access token endpoint URL of your uffd setup.'
;
$lang
[
'uffd-userinfourl'
]
=
'The userinfo endpoint URL of your uffd setup.'
;
$lang
[
'singleService'
]
=
'Login with single oAuth service only (disables local logins!)'
;
$lang
[
'singleService_o_'
]
=
'Allow all services'
;
$lang
[
'register-on-auth'
]
=
'Register authenticated users even if self-registration is disabled in main configuration'
;
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