# Discourse-saml + Okta endless redirect

**URL:** <https://meta.discourse.org/t/discourse-saml-okta-endless-redirect/55525>\
**Category:** SSO\
**Created:** [10 בינואר,‏ 2017,‏ 8:51pm UTC](https://meta.discourse.org/t/discourse-saml-okta-endless-redirect/55525 "2017-01-10T20:51:29Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![runofthemill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/runofthemill/32/56919_2.png) [@runofthemill](https://meta.discourse.org/u/runofthemill)\
**Post date:** [11 בינואר,‏ 2017,‏ 6:53pm UTC](https://meta.discourse.org/t/discourse-saml-okta-endless-redirect/55525/6 "2017-01-11T18:53:34Z")

</div>

So it’s now pulling in the correct data for the email field, but gives “Something went wrong” when the user proceeds to create a new account.

The logs show an error with `"Undefined method 'strip' in /app/controllers/users_controller"` at line 311, and I think it’s because strip expects a string, and it’s getting an object. But if I add `.to_s` to `result.email = auth.extra[:raw_info].attributes['screenName']`, the new user’s email shows up as `["jeremy.miller+test@teamrubiconusa.org"]` so that’s not quite the right solution…

I’m not a Ruby or Rails developer, so I’m not sure the correct way to handle this; any thoughts?

Edit: turns out this is all I needed to do:

```
result.email = auth.extra[:raw_info].attributes['screenName'].try(:first)

```

---

_[View the full topic](https://meta.discourse.org/t/discourse-saml-okta-endless-redirect/55525)._
