Reliable way to extract IdP from ID Token #2339
-
I was wondering if there is a reliable way to determine the IdP from an ID Token when having multiple IdPs connected to dex? I know that the IdP-ID configured in dex gets packaged into the # base64 decoding of a `sub` field received from dex
❯ echo "CiRkMTgxOGFkNi1hNDg3LTRjMWQtOWNlYy1mZTgyODE3NDY5ZDgSFmRhcmtuZXNzLW15LW9sZC1mcmllbmQ" | base64 -d
$d1818ad6-a487-4c1d-9cec-fe82817469d8darkness-my-old-frie%
# should be called "darkness-my-old-friend" not "...frie" Since the other part of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
The
sub
claim is encoded with the base64url encoding. There are various tools to decode it. For example, in Golang there is a special base64 decoder for it - https://pkg.go.dev/encoding/base64#RawURLEncoding