Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
hdacloud
dex
Commits
d0991459
Commit
d0991459
authored
7 years ago
by
Eric Chiang
Browse files
Options
Downloads
Patches
Plain Diff
authproxy: update docs and set a userID
parent
751c565e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/authproxy.md
+43
-5
43 additions, 5 deletions
Documentation/authproxy.md
connector/authproxy/authproxy.go
+1
-0
1 addition, 0 deletions
connector/authproxy/authproxy.go
with
44 additions
and
5 deletions
Documentation/authproxy.md
+
43
−
5
View file @
d0991459
# External authentication
# Authenticating proxy
NOTE: This connector is experimental and may change in the future.
## Overview
## Overview
The authproxy connector returns identities based on authentication which your
The
`authproxy`
connector returns identities based on authentication which your
front-end web server performs.
front-end web server performs. Dex consumes the
`X-Remote-User`
header set by
the proxy, which is then used as the user's email address.
__
The proxy MUST remove any
`X-Remote-*`
headers set by the client, for any URL
path, before the request is forwarded to dex.__
The connector does not support refresh tokens or groups
at this point
.
The connector does not support refresh tokens or groups.
## Configuration
## Configuration
The
`authproxy`
connector is used by proxies to implement login strategies not
supported by dex. For example, a proxy could handle a different OAuth2 strategy
such as Slack. The connector takes no configuration other than a
`name`
and
`id`
:
```
yaml
connectors
:
# Slack login implemented by an authenticating proxy, not by dex.
-
type
:
authproxy
id
:
slack
name
:
Slack
```
The proxy only needs to authenticate the user when they attempt to visit the
callback URL path:
```
( dex issuer URL )/callback/( connector id )?( url query )
```
For example, if dex is running at
`https://auth.example.com/dex`
and the connector
ID is
`slack`
, the callback URL would look like:
```
https://auth.example.com/dex/callback/slack?state=xdg3z6quhrhwaueo5iysvliqf
```
The proxy should login the user then return them to the exact URL (inlucing the
query), setting
`X-Remote-User`
to the user's email before proxying the request
to dex.
## Configuration example - Apache 2
The following is an example config file that can be used by the external
The following is an example config file that can be used by the external
connector to authenticate a user.
connector to authenticate a user.
...
@@ -84,4 +122,4 @@ virtual host configuration in e.g. `/etc/apache2/sites-available/sso.conf`:
...
@@ -84,4 +122,4 @@ virtual host configuration in e.g. `/etc/apache2/sites-available/sso.conf`:
</VirtualHost>
</VirtualHost>
```
```
Then, enable it using
`a2ensite sso.conf`
, followed by a restart of Apache2.
Then, enable it using
`a2ensite sso.conf`
, followed by a restart of Apache2.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
connector/authproxy/authproxy.go
+
1
−
0
View file @
d0991459
...
@@ -50,6 +50,7 @@ func (m *callback) HandleCallback(s connector.Scopes, r *http.Request) (connecto
...
@@ -50,6 +50,7 @@ func (m *callback) HandleCallback(s connector.Scopes, r *http.Request) (connecto
// TODO: add support for X-Remote-Group, see
// TODO: add support for X-Remote-Group, see
// https://kubernetes.io/docs/admin/authentication/#authenticating-proxy
// https://kubernetes.io/docs/admin/authentication/#authenticating-proxy
return
connector
.
Identity
{
return
connector
.
Identity
{
UserID
:
remoteUser
,
// TODO: figure out if this is a bad ID value.
Email
:
remoteUser
,
Email
:
remoteUser
,
EmailVerified
:
true
,
EmailVerified
:
true
,
},
nil
},
nil
...
...
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