Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
sso
Commits
b5ad9abf
Commit
b5ad9abf
authored
Dec 11, 2016
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document the authentication module API
parent
877e7c5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
src/sso_server/sso_server/auth/__init__.py
src/sso_server/sso_server/auth/__init__.py
+31
-0
No files found.
src/sso_server/sso_server/auth/__init__.py
View file @
b5ad9abf
...
...
@@ -32,10 +32,41 @@ class AuthBase(object):
self
.
config
=
config
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment