# Getting invalid user in rules, while doing auth with SAML (Okta)

**URL:** <https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775>\
**Category:** Get Help\
**Tags:** okta, rules, saml\
**Created:** [February 7, 2022, 6:58am UTC](https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775 "2022-02-07T06:58:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raja](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raja/32/34727_2.png) [@raja](https://community.auth0.com/u/raja)\
**Post date:** [February 7, 2022, 6:58am UTC](https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775/1 "2022-02-07T06:58:13Z")

</div>

I’ve created a private okta integration, following the instruction here.

> **[Configure Okta as SAML Identity Provider](https://auth0.com/docs/authenticate/protocols/saml/saml-sso-integrations/configure-auth0-saml-service-provider/configure-okta-as-saml-identity-provider)**
>
> Learn how to configure Okta as an SAML identity provider (IdP) in Auth0.

I am getting an invalid, empty user in the rule. Even when I test the saml connection with rule, the auth0 debug page shows empty user object. Rule throw following error when I try to `JSON.stringify(user)`

> {“errors”:[{“extensions”:{“path”:“$”,“code”:“validation-failed”},“message”:“expecting a value for non-nullable variable: "email"”}]}

---

<div class="post-metadata">

**Author:** ![raja](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raja/32/34727_2.png) [@raja](https://community.auth0.com/u/raja)\
**Post date:** [February 9, 2022, 6:22am UTC](https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775/2 "2022-02-09T06:22:57Z")

</div>

I figured it out, we need to do custom user attribute mapping from okta for this to work.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 9, 2022, 1:19pm UTC](https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775/3 "2022-02-09T13:19:32Z")

</div>

Great! Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 22, 2022, 2:49pm UTC](https://community.auth0.com/t/getting-invalid-user-in-rules-while-doing-auth-with-saml-okta/77775/4 "2022-02-22T14:49:00Z")

</div>


