Skip to content

Commit

Permalink
Make SAML username attribute configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
yflory committed Aug 20, 2024
1 parent dc081cb commit b36b96e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions protocols/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const Util = require("../../../common-util");

const TYPE = 'saml';

const nameRef = 'urn:oid:2.16.840.1.113730.3.1.241';


module.exports = (SSOUtils) => {
const opts = SSOUtils.getOptions();
const getClient = (cfg, cb) => {
Expand Down Expand Up @@ -47,6 +44,8 @@ module.exports = (SSOUtils) => {
if (err || !value) { return void cb('EINVAL'); }
const data = Util.tryParse(value);

const nameRef = cfg.username_attr || 'displayName' || 'urn:oid:2.16.840.1.113730.3.1.241';

getClient(cfg, (err, client) => {
if (err) { return void cb ('E_OIDC_CONNECT'); }
client.validatePostResponseAsync({
Expand Down

0 comments on commit b36b96e

Please sign in to comment.