Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
sso
Merge requests
!2
Auth api refactor
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Auth api refactor
auth-api-refactor
into
master
Overview
0
Commits
5
Pipelines
0
Changes
6
Merged
ale
requested to merge
auth-api-refactor
into
master
8 years ago
Overview
0
Commits
5
Pipelines
0
Changes
6
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f801e018
5 commits,
8 years ago
6 files
+
123
−
35
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/sso_server/sso_server/auth/__init__.py
+
32
−
1
Options
@@ -29,13 +29,44 @@ class AuthBase(object):
supports_otp
=
False
def
__init__
(
self
,
config
):
self
.
config
=
config
pass
def
authenticate
(
self
,
username
,
password
,
otp
=
None
):
"""
Authenticate a user.
Args:
username: username (utf-8 encoded string).
password: password (utf-8 encoded string).
otp: OTP token, if provided by the user. Note that this
should be a string, not an integer.
Returns:
A boolean result indicating successful authentication.
"""
return
False
def
match_groups
(
self
,
username
,
groups
):
"""
Match user groups against requested ones.
Args:
username: username (utf-8 encoded string).
groups: collection (list, set) of requested groups. Group
names are strings.
Returns:
An unsorted collection (set) containing the intersection of
the groups that the user is a member of and the requested
groups.
"""
return
set
()
def
get_user_email
(
self
,
username
):
"""
Return the email address associated with a user.
The SAML module requires this information: some endpoints
(Gitlab, for instance) make use of it to match local records.
Args:
username: username (utf-8 encoded string).
Returns:
The email address associated with the user, or None.
"""
return
None
Loading