# IdP/Database Hybrid

**URL:** <https://forum.inductiveautomation.com/t/idp-database-hybrid/39432>\
**Category:** Ignition\
**Created:** [October 6, 2020, 6:00pm UTC](https://forum.inductiveautomation.com/t/idp-database-hybrid/39432 "2020-10-06T18:00:00Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [February 10, 2021, 1:15am UTC](https://forum.inductiveautomation.com/t/idp-database-hybrid/39432/5 "2021-02-10T01:15:48Z")

</div>

This works for me:

```auto
runScript("system.user.getUser('MySQL_User_Source', '" + {idp-attributes:/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:NameID/text()} + "').getRoles()")

```

where `MySQL_User_Source` is the name of my user source profile.

Since we are passing jython source code as a string to the runScript expression function, we need to embed the username in the part of the source code where the username argument goes to the `system.user.getUser` script function using string concatenation (string concatenation is handled by the Ignition expression itself). Just swap my XPath expression (`/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:NameID/text()`) with the XPath expression you need to dereference the username in your SAML response and it should work.

---

_[View the full topic](https://forum.inductiveautomation.com/t/idp-database-hybrid/39432)._
