Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amundsen_dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Surendar Reddy Mangannagari
amundsen_dev
Commits
0fcbe6b0
Commit
0fcbe6b0
authored
May 28, 2019
by
Verdan Mahmood
Committed by
Tao Feng
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the doc on how to set Auth User Method (#175)
parent
779548bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
oidc.md
docs/authentication/oidc.md
+29
-0
No files found.
docs/authentication/oidc.md
View file @
0fcbe6b0
...
...
@@ -68,5 +68,34 @@ REQUEST_HEADERS_METHOD = get_access_headers
This function will be called using the current
`app`
instance to add the headers in each request when calling any endpoint of
metadatalibrary and searchlibrary
[
here
](
https://github.com/lyft/amundsenfrontendlibrary/blob/master/amundsen_application/api/utils/request_utils.py
)
## Setting Up Auth User Method
In order to get the current authenticated user (which is being used in Amundsen for many operations), we need to set
`AUTH_USER_METHOD`
config variable in frontendlibrary.
This function should return email address, user id and any other required information.
-
Define a function to fetch the user information in your config.py:
```
python
def
get_auth_user
(
app
):
"""
Retrieves the user information from oidc token, and then makes
a dictionary 'UserInfo' from the token information dictionary.
We need to convert it to a class in order to use the information
in the rest of the Amundsen application.
:param app: The instance of the current app.
:return: A class UserInfo
"""
from
flask
import
g
user_info
=
type
(
'UserInfo'
,
(
object
,),
g
.
oidc_id_token
)
# noinspection PyUnresolvedReferences
user_info
.
user_id
=
user_info
.
preferred_username
return
user_info
```
-
Set the method as the auth user method in your config.py:
```
python
AUTH_USER_METHOD
=
get_auth_user
```
Once done, you'll have the end-to-end authentication in Amundsen without any proxy or code changes.
\ No newline at end of file
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