nhost / hasura-backend-plus

🔑Auth and 📦Storage for Hasura. The quickest way to get Auth and Storage working for your next app based on Hasura.
https://nhost.github.io/hasura-backend-plus/
MIT License
1.17k stars 187 forks source link

Custom Claims Endpoint #643

Open ArieJones opened 3 years ago

ArieJones commented 3 years ago

Is your feature request related to a problem? Please describe. We are wanting the ability to support more complex claims scenarios.. for example in scenarios in which the claims structure and logic might be too complex to put within individual fields within the USERS table

Describe the solution you'd like An environment variable similar to what Hasura offers ( HASURA_GRAPHQL_AUTH_HOOK) maybe NHOST_GRAPHQL_AUTH_HOOK which would point to an endpoint in the custom api which would be used in the same manner as the Hasura implementation shown here https://github.com/hasura/graphql-engine/blob/master/community/boilerplates/auth-webhooks/nodejs-express/server.js

Describe alternatives you've considered We've looked at various other solutions such as cobbling together some kind of json based string in a field in the USERS table but it becomes messy when you would have to update more than one account.