# Sub formatting in the JWT ID Token for Enterprise Connections

**URL:** <https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837>\
**Category:** Get Help\
**Tags:** free-trial, connections, saml-enterprise-connection\
**Created:** [February 25, 2025, 4:32pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837 "2025-02-25T16:32:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadia.zyborska](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nadia.zyborska/32/60446_2.png) [@nadia.zyborska](https://community.auth0.com/u/nadia.zyborska)\
**Post date:** [February 25, 2025, 4:32pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837/1 "2025-02-25T16:32:39Z")

</div>

Hello,

I’m looking to get more information on the exact structure that auth0 formats the sub (user\_id) in the incoming callback in the JWT ID token once a user is authentication in auth0.

For example the auth0 database format is: `auth0|xxxxx`  
A google social connection is: `google-oauth2|xxxxx`

This is pretty standard. However now I want to set up a self serve SSO and want to be able to decipher the connection using the incoming sub.  
When I create a custom SAML connection the sub of the user has the format:  
`samlp|connection-name|user-id-from-idp`.  
I can see the same is the case for custom oidc:  
`odic|connection-name|user-id-from-idp`.

I would like to know how the sub’s in the other Identity Provider types would be formatted for each of the options in the self serve SSO flow (see image).

Thanks in advance!

 ![Screenshot 2025-02-25 at 13.24.25](https://global.discourse-cdn.com/auth0/original/3X/f/b/fbd829f0b6022e75e589cc53c9860de06dd1559d.png)

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 25, 2025, 5:01pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837/3 "2025-02-25T17:01:13Z")

</div>

Hi @nadia.zyborska

Welcome to the Auth0 Community!

You can view these values under our documentation about [Enterprise Connections](https://auth0.com/docs/authenticate/enterprise-connections). To save you a bit of time, they would be:

- `ad` (Active Directory/LDAP)
- `adfs` (ADFS)
- `auth0-adldap`
- `google-apps` (Google Workspace)
- `ip`
- `office365`
- `oidc` (OpenID Connect)
- `pingfederate` (PingFederate)
- `samlp` (SAML)
- `sharepoint`
- `waad` (Microsoft Azure AD)

Hope this helps! If you have any other questions, feel free to let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![nadia.zyborska](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nadia.zyborska/32/60446_2.png) [@nadia.zyborska](https://community.auth0.com/u/nadia.zyborska)\
**Post date:** [February 25, 2025, 5:35pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837/4 "2025-02-25T17:35:57Z")

</div>

Amazing, thanks @nik.baleca!  
Am I correct in thinking that for each of these Enterprise connections, a new connection will be created in auth0 and the name would be included in the sub with the following format:  
`enterprise-connection-strategy|connection-name|idp-user-id` for each of the enterprise connections?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 25, 2025, 5:56pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837/5 "2025-02-25T17:56:07Z")

</div>

Hi again!

Yes, that is right!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 11, 2025, 5:56pm UTC](https://community.auth0.com/t/sub-formatting-in-the-jwt-id-token-for-enterprise-connections/182837/6 "2025-03-11T17:56:45Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
