vippsas / vipps-developers

Please see: Vipps MobilePay Technical Documentation: https://developer.vippsmobilepay.com

Home Page:https://developer.vippsmobilepay.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for custom claims in JWT

RyszardRzepa opened this issue · comments

Hey,

I can´t find this feature in the docs.
Does vipps auth support adding custom claims into JWT token?

Example of how firebase auth support this feature: https://firebase.google.com/docs/auth/admin/custom-claims#set_and_validate_custom_user_claims_via_the_admin_sdk

example custom claim:

{
  "sub": "1234567890",
  "name": "John Doe",
  "admin": true,
  "iat": 1516239022,
  "https://hasura.io/jwt/claims": {
    "x-hasura-allowed-roles": ["editor","user", "mod"],
    "x-hasura-default-role": "user",
    "x-hasura-user-id": "1234567890",
    "x-hasura-org-id": "123",
    "x-hasura-custom": "custom-value"
  }
}

Hi @RyszardRzepa
This is not something we have support for in our authentication solution, apologies for this.

Could you expand on your use case for this? It would be nice to get a better understanding so we can consider if this is a feature worth investing time in.

I am using hasura.io engine for managing authentication/authorization for Postgres db. Hasura has requirements to enhance user roles in the JWT.
https://hasura.io/docs/1.0/graphql/manual/auth/authentication/index.html

The use case:
Managing user roles from the auth service make it straight forward to build authorization service in db.

Hi @RyszardRzepa

Apologies for the hideously late response.

The functionality you describe is not something Vipps will implement, sorry.

Christian, Vipps