Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Wolfgang Knopki
Spacedeck-open-SAML
Commits
aa52563d
Commit
aa52563d
authored
4 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
add entry point redirect after saml/SSO
parent
a0fb802f
master
saml-integration
1 merge request
!4
Saml integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/root.js
+3
-3
routes/root.js
with
3 additions
and
3 deletions
+3
-3
routes/root.js
+
3
-
3
View file @
aa52563d
...
...
@@ -62,7 +62,7 @@ const uuidv4 = require('uuid/v4');
}
);
router
.
post
(
'
/saml/SSO
'
,
passport
.
authenticate
(
'
saml
'
,
{
failureRedirect
:
'
/login
'
,
failureFlash
:
true
}),
function
(
req
,
res
){
router
.
post
(
'
/saml/SSO
'
,
passport
.
authenticate
(
'
saml
'
,
{
failureRedirect
:
config
.
entryPoint
+
'
/login
'
,
failureFlash
:
true
}),
function
(
req
,
res
){
const
xmlResponse
=
req
.
body
.
SAMLResponse
;
const
parser
=
new
Saml2js
(
xmlResponse
);
const
response
=
parser
.
toObject
();
...
...
@@ -140,7 +140,7 @@ router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: '/logi
ip
:
req
.
ip
,
device
:
"
web
"
,
created_at
:
new
Date
(),
url
:
"
/
"
url
:
config
.
entryPoint
};
db
.
Session
.
create
(
session
)
...
...
@@ -152,7 +152,7 @@ router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: '/logi
var
domain
=
(
process
.
env
.
NODE_ENV
==
"
production
"
)
?
new
URL
(
config
.
get
(
"
endpoint
"
)).
hostname
:
req
.
headers
.
hostname
;
console
.
log
(
"
session set successfully
"
);
res
.
cookie
(
'
sdsession
'
,
token
,
{
domain
:
domain
,
httpOnly
:
true
});
res
.
redirect
(
302
,
"
/
"
)
res
.
redirect
(
302
,
config
.
entryPoint
)
});
});
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets