Skip to content

use AccessToken with custom claims and definable 3rd party signing key #2597

Closed

Description

@logemann

Feature request

Right now it seems the token needed for Auth against the supabase DB is quite custom. I looked at Hasura and there its so much easier to work with a 3rd party auth service like Auth0 because you can just use the AccessToken from Auth0 with some custom Claims in it.

Describe the solution you'd like

I want to put the signage key of the token (i get from auth0) in the Supabase admin section. And i want the needed things for supabase in namespaced custom claims inside the token. This can be easily done with Auth0 (actions). With that i can just pass the AccessToken (JWT compliant) of Auth0 to Supabase.

Supabase can do the Token verification easily with the provided key. All in all i dont need a cloud function with generates me a Supabase compliant JWT, which is always a hassle because the mentioned cloud function service also needs to auth against my current Auth0 user. So a lot of headaches.

Describe alternatives you've considered

I checked Hasura for a good way to do it.
See https://hasura.io/learn/graphql/nextjs-fullstack-serverless/auth0-setup/ for a no-brainer how to integrate Auth0 with Hasura without the need to create custom JWTs.

Activity

  1. added
    enhancement
    on Jul 27, 2021
  2. added
    auth
    on Jul 18, 2022
  3. kiwicopple commented on Sep 26, 2022

    @kiwicopple
    Member

    Custom claims can be managed by inserting the data into the auth.users.raw_app_metadata column.

    We have a good article on it here: https://dev.to/supabase/supabase-custom-claims-34l2

    Sorry this one took so long to respond to! 😓 we're going through the backlog now, and I'm starting from the oldest -> newest, and it looks like this got lost in the noise

    Hopefully the article above answers your question comprehensively, but if there's anything missing just let me know and I can reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions