Skip to content

Commit

Permalink
#24
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 authored and yurem committed Oct 16, 2018
1 parent a175bf2 commit 2811be7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions server/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,14 @@ var callbackAuthzResponse = function (req, res) {
if (!req.user) {
return res.redirect(global.config.applicationStartpoint + '?failure=Unauthorized');
}

logger.log2("callbackAuthzResponse. Full req is\n%s", JSON.stringify(req))
var provider = req.user.providerKey
var idp_initiated_config = global.saml_idp_init_config[provider]
//TODO: is sp_id part of req? no idea where to grab it from?
var sp_id = undefined

if (idp_initiated_config && idp_initiated_config[sp_id]) {

// TODO: what?
// TODO: In saml.js we need to call openid.getAuthorizationEndpoint if Saml entiry_id has OpenId setting
client = idp_initiated_config[sp_id].openidclient
authorization_params = idp_initiated_config[sp_id].authorization_params

Expand Down Expand Up @@ -190,10 +188,6 @@ var callbackAuthzResponse = function (req, res) {
})
logger.log2('debug', 'Preparing to send authorization request with user data to: %s with JWT=%s', authorization_endpoint, jwt)

//TODO: I commented the immediate line below, not sure how the impl of getAuthorizationQuery is and why client param is needed
//authorizationRequest = openid.getAuthorizationQuery(client, jwt)
//TODO: This is how I understand it could be, it's missing properly url encoding

authorization_params_cloned = JSON.parse(JSON.stringify(authorization_params))
authorization_params_cloned['session_state'] = JSON.stringify(jwt)
authorization_url = openid.getAuthorizationUrl(authorization_endpoint, authorization_params_cloned)
Expand Down

0 comments on commit 2811be7

Please sign in to comment.