TIB : How to include meta data in the token

I have a TIB node installed which communicates with a custom identity provider.
This Custom IDP returns a json like this :

  "granted": "true",
  "userid": 12345,
  "user_name": "fmeriot",
  "access_token": "123456789"

When I request a token on my TIB at http://{TIB-IP}:3010/auth/{profile-id}/proxy I successfully recieve a token. But, when I inspect this token, I only retrieve this meta data :

As you can see, I only have AccessToken (123456789) and user_name (as AuthProviderUserID) in my token.

How can I do to include the missing fields (“granted” and “userid” fields)?

Thank you for your help


Short answer: No, unfortunately TIB currently only extracts those two fields for the proxy provider :-/

Longer answer:

In TIB, the “provider” is separated from the “handler”, and they interchange a uniform object goth.User, the TIB Proxy provider currently only deserialises for the two name spaces (access token and user ID).

If you’re up for some tinkering, it can be extended here:

(gabs is a handy little library that lets you access JSON using dot-notation). The goth.User object is in the gothic library here:

We standardised o it because it works for all of the OAuth / Social connectors and encapsulates things quite nicely.

If you don’t want to modify TIB (and I don’t blame you), then the only thing I could think of doing is to serialise the full user data as a b64 string into the user-id field in your IDP so that you can extract it at your service layer, but that might not be very palatable.

Ok, I will encode my custom DTO in the access_toke field.

Thank you