# Voeg configureerbare optie toe voor keuze tussen JWT en UserInfo

**URL:** https://meta.discourse.org/t/add-configurable-option-for-choosing-between-jwt-and-userinfo/312951
**Category:** Feature
**Tags:** openid-connect
**Created:** [20 juni 2024 om 21:28 UTC](https://meta.discourse.org/t/add-configurable-option-for-choosing-between-jwt-and-userinfo/312951 "2024-06-20T21:28:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![klin938](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klin938/32/425947_2.png) [@klin938](https://meta.discourse.org/u/klin938)
#### Post date: [20 juni 2024 om 21:28 UTC](https://meta.discourse.org/t/add-configurable-option-for-choosing-between-jwt-and-userinfo/312951/1 "2024-06-20T21:28:23Z")

</div>

Hi guys,

I am having an issue when setting up oidc with our Azure AD backend. I want to use `preferred_username` as the default username since this is only field which is unique (email and name are recycled and reusable)

`preferred_username` is returned by JWT via ‘profile’ scope, but not by the UserInfo endpoint. And because UserInfo appears in the discovery document, the plugin opt to use it instead of JWT, making `preferred_username` unavailable for username suggestion.

I have seen another user got similar issue and he needed to patch the code himself ([here](https://meta.discourse.org/t/openid-with-line-biz-email-in-jwt-missing-in-userinfo/238789))

Microsoft actually recommends to [use JWT instead of UserInfo](https://learn.microsoft.com/en-us/entra/identity-platform/userinfo#notes-and-caveats-on-the-userinfo-endpoint).

I think it is sensible to provide it as a configurable option?

Cheers
