# Enforcing Terms and Conditions with IdPs

**URL:** <https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594>\
**Category:** Get Help\
**Tags:** lock\
**Created:** [March 18, 2020, 1:08pm UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594 "2020-03-18T13:08:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.farnsworth](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.farnsworth/32/19885_2.png) [@michael.farnsworth](https://community.auth0.com/u/michael.farnsworth)\
**Post date:** [March 18, 2020, 1:08pm UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594/1 "2020-03-18T13:08:50Z")

</div>

I’m not the first one to ask this: [Enforce terms consent for social login via lock](http://community.auth0.com/t/enforce-terms-consent-for-social-login-via-lock/19130). But I haven’t seen a satisfying solution.

With the `mustAcceptTerms: true` option set in Locks, users who signup with an IdP are forced to check the terms-and-conditions checkbox. Great! However, as has been pointed out, they can still login with that IdP, bypassing the terms-and-conditions check.

The linked solution suggests adding a rule to check for a `app_metadata.terms_accepted` flag. However, no such flag gets set when the user checks the checkbox. You can create an addition hidden property, but that only works for database accounts.

As far as I can tell, there is no way to tell if a IdP user has check the terms-and-conditions checkbox the first time the login or signup. So the solution is to…always assume they haven’t checked it? That would be a terrible user experience for users who actually did.

Am I missing something obvious here? I worked on this problem for nearly twelve hours yesterday and have not come up with a viable solution.

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [March 19, 2020, 8:14am UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594/2 "2020-03-19T08:14:25Z")

</div>

Hi @michael.farnsworth,

Note that as per docs:

[https://auth0.com/docs/libraries/lock/v11/configuration#mustacceptterms-boolean-](https://auth0.com/docs/libraries/lock/v11/configuration#mustacceptterms-boolean-)

the flag only applies to database connection users.

Also, I don’t think relying on that checkbox that `mustAcceptTerms` (which only shows on the signup tab but not the login tab) is reliable, because technically, for Social Connections there’s no difference between a login and a signup. A user can as well use the “Login with Google” on the login tab instead of signup tab with no difference (even if he hasn’t loggedin/signed up before).

I would use a [redirect rule](https://auth0.com/docs/rules/guides/redirect) with a custom consent page (on your end), and store this information in the user’s metadata. Then check for it in a Rule at login whether he’s accepted it yet or not.

- [GDPR: Conditions for Consent](https://auth0.com/docs/compliance/gdpr/features-aiding-compliance/user-consent)
- [GDPR: Track Consent with Custom UI](https://auth0.com/docs/compliance/gdpr/features-aiding-compliance/user-consent/track-consent-with-custom-ui)

* * *

Update: I actually just found that that checkbox `mustAcceptTerms` is a pure client-side check (obviously, as it’s just a configuration set on the client side). And you are right, it doesn’t get stored anywhere in the user profile. I will report that internally.

So, if you go into the HTML DOM and remove the ‘disabled’ attribute, a user can even signup without checking that checkbox, which obviously isn’t intended.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/1/c1f62888b5edaf1b082343fa61bb1e0589cdfe46.png)

So, therefore, for the moment I’d even more recommend to go with the approach outlined above.

---

<div class="post-metadata">

**Author:** ![michael.farnsworth](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael.farnsworth/32/19885_2.png) [@michael.farnsworth](https://community.auth0.com/u/michael.farnsworth)\
**Post date:** [March 24, 2020, 8:27pm UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594/3 "2020-03-24T20:27:58Z")

</div>

Thanks for the reply. At least, now I know I wasn’t missing something simple.

-Michael

---

<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:** [March 25, 2020, 11:30am UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594/4 "2020-03-25T11:30:47Z")

</div>

Glad we were able to help!

---

<div class="post-metadata">

**Author:** ![philipp.ebneter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/philipp.ebneter/32/20907_2.png) [@philipp.ebneter](https://community.auth0.com/u/philipp.ebneter)\
**Post date:** [April 30, 2020, 8:06am UTC](https://community.auth0.com/t/enforcing-terms-and-conditions-with-idps/39594/5 "2020-04-30T08:06:07Z")

</div>

Just to help drawing attention to this thread: We are also struggling with this!  
We would have expected that Auth0 provides a lean solution for this. We are discussing various workaround right now that will lead to worse user experience 🙁
