Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (options.profile) {
var sreg = new openid.SimpleRegistration({
"fullname" : true,
"nickname" : true,
"email" : true,
"dob" : true,
"gender" : true,
"postcode" : true,
"country" : true,
"timezone" : true,
"language" : true
});
extensions.push(sreg);
}
if (options.profile) {
var ax = new openid.AttributeExchange({
"http://axschema.org/namePerson" : "required",
"http://axschema.org/namePerson/first": "required",
"http://axschema.org/namePerson/last": "required",
"http://axschema.org/contact/email": "required"
});
extensions.push(ax);
}
if (options.ui) {
// ui: { mode: 'popup', icon: true, lang: 'fr-FR' }
var ui = new openid.UserInterface(options.ui);
extensions.push(ui);
}
if (options.pape) {
var papeOptions = {};
if (options.profile) {
var sreg = new openid.SimpleRegistration({
"fullname" : true,
"nickname" : true,
"email" : true,
"dob" : true,
"gender" : true,
"postcode" : true,
"country" : true,
"timezone" : true,
"language" : true
});
extensions.push(sreg);
}
if (options.profile) {
var ax = new openid.AttributeExchange({
"http://axschema.org/namePerson" : "required",
"http://axschema.org/namePerson/first": "required",
"http://axschema.org/namePerson/last": "required",
"http://axschema.org/contact/email": "required"
});
extensions.push(ax);
}
if (options.ui) {
// ui: { mode: 'popup', icon: true, lang: 'fr-FR' }
var ui = new openid.UserInterface(options.ui);
extensions.push(ui);
}
if (options.pape) {
var papeOptions = {};
.definit( function () {
this.relyingParty = new oid.RelyingParty(this.myHostname() + this.callbackPath(), null, false, false, [
new oid.UserInterface()
, new oid.SimpleRegistration(this.simpleRegistration())
, new oid.AttributeExchange(this.attributeExchange())
]);
})
.get('entryPath',
.definit( function () {
this.relyingParty = new oid.RelyingParty(this.myHostname() + this.callbackPath(), null, false, false, [
new oid.UserInterface()
, new oid.SimpleRegistration(this.simpleRegistration())
, new oid.AttributeExchange(this.attributeExchange())
]);
})
.get('entryPath',
module.exports = function (app, address, port) {
var openid = require('openid');
var dependency = require("find-dependencies")(__dirname),
logger = dependency.global.require(dependency.global.util.location, "lib/logging.js")(__filename) || console,
pzhAdaptor = require('../pzhadaptor.js'),
helper = require('./helper.js');
var attr = new openid.AttributeExchange({
"http://axschema.org/contact/country/home":"required",
"http://axschema.org/namePerson/first":"required",
"http://axschema.org/pref/language":"required",
"http://axschema.org/namePerson/last":"required",
"http://axschema.org/contact/email":"required",
"http://axschema.org/namePerson/friendly":"required",
"http://axschema.org/namePerson":"required",
"http://axschema.org/media/image/default":"required",
"http://axschema.org/person/gender/":"required"
});
app.get('/main/:useremail/request-access-login', function (req, res) {
//Args: External user's PZH URL
//Args: External user's PZH certificate
//Auth: Check that the certificate is valid and that the certificate is valid for this URL.
//UI: Presents a button that the user must click to confirm the request
exports.authenticate = function(hostname, url, res, query) {
var exts= [];
var attr = new openid.AttributeExchange({
"http://axschema.org/contact/country/home": "required",
"http://axschema.org/namePerson/first": "required",
"http://axschema.org/pref/language": "required",
"http://axschema.org/namePerson/last": "required",
"http://axschema.org/contact/email": "required",
"http://axschema.org/namePerson/friendly": "required",
"http://axschema.org/namePerson": "required",
"http://axschema.org/media/image/default": "required",
"http://axschema.org/person/gender/": "required"
});
exts.push(attr);
rely = new openid.RelyingParty('https://'+hostname+':'+
session.configuration.port.farm_webServerPort+'/main.html?cmd=verify&id='+query.id,
null,
false,
false,
if (options.profile) {
var sreg = new openid.SimpleRegistration({
"fullname" : true,
"nickname" : true,
"email" : true,
"dob" : true,
"gender" : true,
"postcode" : true,
"country" : true,
"timezone" : true,
"language" : true
});
extensions.push(sreg);
}
if (options.profile) {
var ax = new openid.AttributeExchange({
"http://axschema.org/namePerson/first": "required",
"http://axschema.org/namePerson/friendly": "required",
"http://axschema.org/namePerson/last": "required",
"http://axschema.org/contact/email": "required",
"http://axschema.org/person/gender": "required",
"http://openid.net/schema/person/guid": "required"
});
extensions.push(ax);
}
this._relyingParty = new openid.RelyingParty(
options.returnURL,
options.realm,
(options.stateless === undefined) ? false : options.stateless,
(options.secure === undefined) ? true : options.secure,
extensions);