Accessing Custom User Data in FusionAuth's /oauth2/userinfo Endpoint
-
In the /api/user endpoint, we had access to the data.salutation value. However, this information is no longer available in the /oauth/userinfo endpoint. Since we are required to transition to the new API due to the old one being sunset at the end of the year, how can we retrieve this value?
-
There seems to be a misunderstanding regarding the deprecation timeline. The /api/user endpoint itself is not being deprecated at the end of the year; only JWT authentication for that API is being deprecated. You can continue to use the /api/user endpoint by switching to API key-based authentication.
Steps to Continue Using /api/user:
- Update your integration to authenticate API calls with an API key instead of JWT.
- Access data.salutation as usual through the /api/user endpoint. This data is part of the user.data object, which is populated by your integration and not automatically generated by FusionAuth.
Steps to Use /oauth2/userinfo:
- Write and install a UserInfo lambda which can read the user.data object and augment the userinfo response to include the data.salutation value. Docs on this lambda.
-