Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetaGer Keymanager
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer Keymanager
Commits
825f8068
Commit
825f8068
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
switching to keycloak as authentication gateway
parent
11ad69fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pass/routes/authentication.js
+16
-5
16 additions, 5 deletions
pass/routes/authentication.js
with
16 additions
and
5 deletions
pass/routes/authentication.js
+
16
−
5
View file @
825f8068
...
@@ -2,9 +2,12 @@ var express = require("express");
...
@@ -2,9 +2,12 @@ var express = require("express");
var
router
=
express
.
Router
();
var
router
=
express
.
Router
();
const
config
=
require
(
"
config
"
);
const
config
=
require
(
"
config
"
);
const
jose
=
require
(
"
jose
"
);
const
jose
=
require
(
"
jose
"
);
const
{
auth
,
requiresAuth
}
=
require
(
"
express-openid-connect
"
);
const
{
auth
,
requiresAuth
,
Session
}
=
require
(
"
express-openid-connect
"
);
const
dayjs
=
require
(
"
dayjs
"
);
const
session_prefix
=
"
auth:
"
;
const
auth_session_expiration_minutes
=
1
;
const
access_keys_redis_key
=
"
accesskeys
"
;
/**
/**
* Authorization is done using Oauth2 via any GitLab Instance
* Authorization is done using Oauth2 via any GitLab Instance
...
@@ -22,12 +25,20 @@ const session_prefix = "auth:";
...
@@ -22,12 +25,20 @@ const session_prefix = "auth:";
*/
*/
router
.
use
(
router
.
use
(
auth
({
auth
({
issuerBaseURL
:
`
${
config
.
get
(
"
app.
gitlab
.url
"
)}
`
,
issuerBaseURL
:
`
${
config
.
get
(
"
app.
openid_auth
.url
"
)}
`
,
baseURL
:
config
.
get
(
"
app.url
"
),
baseURL
:
config
.
get
(
"
app.url
"
),
clientID
:
config
.
get
(
"
app.
gitlab
.app_id
"
),
clientID
:
config
.
get
(
"
app.
openid_auth
.app_id
"
),
clientSecret
:
config
.
get
(
"
app.
gitlab
.app_secret
"
),
clientSecret
:
config
.
get
(
"
app.
openid_auth
.app_secret
"
),
secret
:
config
.
get
(
"
app.secret
"
),
secret
:
config
.
get
(
"
app.secret
"
),
idpLogout
:
true
,
idpLogout
:
true
,
session
:
{
absoluteDuration
:
1
,
},
afterCallback
:
(
req
,
res
,
session
,
decodedState
)
=>
{
let
access_token
=
session
.
access_token
;
console
.
log
(
session
);
return
session
;
},
authRequired
:
false
,
authRequired
:
false
,
authorizationParams
:
{
authorizationParams
:
{
response_type
:
"
code
"
,
response_type
:
"
code
"
,
...
...
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