# OOD with Shibboleth email addresses

**URL:** <https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706>\
**Category:** Get Help\
**Tags:** feature-request, question\
**Created:** [February 5, 2020, 6:56pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706 "2020-02-05T18:56:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![milberg](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@milberg](https://discourse.openondemand.org/u/milberg)\
**Post date:** [February 5, 2020, 6:56pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/1 "2020-02-05T18:56:25Z")

</div>

We have OOD with Shibboleth auth working (following [https://osc.github.io/ood-documentation/master/authentication/shibboleth.html](https://osc.github.io/ood-documentation/master/authentication/shibboleth.html)). Fields obtained by Shibboleth from IdP include email address, but when attempting to send email to a user, the email address from Shibboleth isn’t used. Instead, email is sent to _uname_@_email-host-domain_ which is invalid. (_uname_ is set correctly by user\_map\_cmd in ood\_portal.yml.) Is there a way to configure OOD to use users’ email addresses from Shibboleth? (If not, even having something like email\_map\_cmd similar to user\_map\_cmd would allow most, but not all, email addresses to be set correctly.)

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 5, 2020, 9:50pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/2 "2020-02-05T21:50:24Z")

</div>

What is the system that’s emailing? We sometimes enable jobs to email when the job starts or finishes. Is that the particular feature/email you’re referring to?

If so, that’s an issue with the scheduler in question. It looks like in the `script` object we can set the `email` user(s) (it’s an array in case you wanted to send emails to multiple users).

So it seems you could add the email field to every submit, which could be kinda painful depending on how many you have to do (and users will have to manually specify it to get it correct when they write/make job scripts or use the cli).

In the case of Slurm (as an example) this translates into every job being submitted with the `--mail-user=foo@bar,other@site` flag. In another scheduler it’s another flag, and so on.

```auto
# the submit/submit.yml.erb for your bc_desktop app.
---
script:
  native:
    - "<%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"
  email: 
    - "<%= ENV['USER'] %>@the-real-domain-I-want.org"

```

Or maybe there’s a config on the scheduler side that we can set? Something like `EMAIL_DOMAIN`. That way we can set it globally (and actually fix the issue for cli users if they happen to run into this).

In either case, it’s the scheduler that’s sending these emails, not open ondemand. So we can force a specific email address to be submitted with the job and brute force configure all the jobs, or fix how the scheduler’s finding the domain.

If this is not enough information and/or you still need more, let us know what type of scheduler you use. Hope that helps!

---

<div class="post-metadata">

**Author:** ![milberg](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@milberg](https://discourse.openondemand.org/u/milberg)\
**Post date:** [February 6, 2020, 5:45pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/3 "2020-02-06T17:45:35Z")

</div>

The feature is the “I would like to receive an email when the session starts” option for apps (Jupyter Notebook and RStudio Server). Adding the email item shown above to the submit.yml.erb for the app worked. This gives us working email for most users, but not for the few whose addresses don’t follow the typical pattern. To get working email for all users, I would still like to make the feature request for apps to be configurable to use email addresses obtained through Shibboleth.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 6, 2020, 7:34pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/4 "2020-02-06T19:34:54Z")

</div>

OK I figured out how our clusters work, it turns out it’s a configuration in our LDAP and mail relays. So if I do a simple `echo test email | mail -s "test" johrstrom` in the command line then the mail relay will query LDAP to find me and extract the email attribute and send to that. That’s just informational in case you want a similar setup in your environment.

Alternatively we could try to find it programmatically in the environment. Can we find the email through an unauthenticated LDAP search?

We’re currently able to pass environment variables to the PUN, but I’m not sure how to do dynamic ones or per user ones like email. The feature that you’re requesting is probably something we’d want longterm to be able to more dynamically react to the users information from the authentication method.

---

<div class="post-metadata">

**Author:** ![milberg](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@milberg](https://discourse.openondemand.org/u/milberg)\
**Post date:** [February 6, 2020, 7:46pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/5 "2020-02-06T19:46:00Z")

</div>

I’ll look into those options, thanks!

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:33pm UTC](https://discourse.openondemand.org/t/ood-with-shibboleth-email-addresses/706/6 "2022-05-26T15:33:48Z")

</div>

Closed on May 26, 2022, 3:33pm UTC


