extract correct entity id for ukamf metadata

GitOrigin-RevId: 4cb1d7f6e5636bbed77c4279d7d7704ab9b9ab77
This commit is contained in:
Ersun Warncke 2019-11-27 11:05:26 -04:00 committed by sharelatex
parent 77b7b03ead
commit 91c4cf16cc
3 changed files with 4 additions and 2 deletions

View file

@ -30,7 +30,7 @@ async function main() {
const samlConfig = entity.getSamlConfig() const samlConfig = entity.getSamlConfig()
console.log(`UPDATE universities SET console.log(`UPDATE universities SET
sso_entity_id = '${entityId}', sso_entity_id = '${samlConfig.entityId}',
sso_entry_point = '${samlConfig.entryPoint}', sso_entry_point = '${samlConfig.entryPoint}',
sso_cert = '${samlConfig.cert}', sso_cert = '${samlConfig.cert}',
sso_user_id_attribute = 'eduPersonPrincipalName', sso_user_id_attribute = 'eduPersonPrincipalName',

View file

@ -22,7 +22,7 @@ class UKAMFDB {
const entity = this.entities.find( const entity = this.entities.find(
matcher instanceof RegExp matcher instanceof RegExp
? e => e.$.entityID.match(matcher) ? e => e.$.entityID.match(matcher)
: e => e.$.entityID === matcher : e => e.$.entityID.includes(matcher)
) )
return entity ? new UKAMFEntity(entity) : null return entity ? new UKAMFEntity(entity) : null
} }

View file

@ -11,6 +11,7 @@ class UKAMFEntity {
const idp = this.data.IDPSSODescriptor[0] const idp = this.data.IDPSSODescriptor[0]
const keys = idp.KeyDescriptor const keys = idp.KeyDescriptor
const signingKey = keys.find(key => _.get(key, ['$', 'use']) === 'signing') const signingKey = keys.find(key => _.get(key, ['$', 'use']) === 'signing')
const entityId = this.data.$.entityID
let cert = _.get(signingKey, [ let cert = _.get(signingKey, [
'ds:KeyInfo', 'ds:KeyInfo',
@ -37,6 +38,7 @@ class UKAMFEntity {
return { return {
cert, cert,
entityId,
entryPoint entryPoint
} }
} }