Stream: dev

Topic: API to identify current user from JSESSIONID cookie


view this post on Zulip Mahendra Paipuri (Jun 03 2026 at 12:46):

Hello, Is there any API endpoint to identify the current logged in user based on the JSESSIONID cookie? I could not find one in the docs. The use case is that we have a custom home page and when the user is logged in, we would like to display the user name in the navbar of the home page. Cheers!

view this post on Zulip Philip Durbin ๐Ÿš€ (Jun 03 2026 at 13:21):

nope

view this post on Zulip Philip Durbin ๐Ÿš€ (Jun 03 2026 at 13:22):

@Vera Clemens any thoughts on this?

view this post on Zulip Mahendra Paipuri (Jun 03 2026 at 13:26):

I see a very similar feature implemented behind feature flag ->#9290

view this post on Zulip Vera Clemens (Jun 03 2026 at 13:26):

Philip Durbin ๐Ÿš€ said:

Vera Clemens any thoughts on this?

Hmm, not really, we are exclusively using OIDC bearer tokens to authenticate and display user information in our custom frontend. I haven't really worked with the JSESSIONID cookie. (@Johannes D do you have any further thoughts?)

view this post on Zulip Philip Durbin ๐Ÿš€ (Jun 03 2026 at 13:42):

@Mahendra Paipuri when you say you are using a custom home page, do you mean you're using :HomePageCustomizationFile as described at https://guides.dataverse.org/en/6.10.1/installation/config.html#custom-homepage

That's what we do for https://dataverse.harvard.edu and if you log in, your name appears at the top, in the navbar.

view this post on Zulip Philip Durbin ๐Ÿš€ (Jun 03 2026 at 13:43):

dvBrandingCustBlocks.png

view this post on Zulip Mahendra Paipuri (Jun 03 2026 at 13:53):

Cheers @Philip Durbin ๐Ÿš€ !! Yes, we are using :HomePageCustomizationFile. But seems like Harvard's Dataverse custom home page is only using the "Body" content. In our case, we have the entire page customized.
image.png

view this post on Zulip Mahendra Paipuri (Jun 03 2026 at 13:53):

Is the custom home page of Harvard Dataverse on a public repo?

view this post on Zulip Philip Durbin ๐Ÿš€ (Jun 03 2026 at 13:54):

Yes! Please go to https://github.com/IQSS/dataverse.harvard.edu under "customization".

view this post on Zulip Oliver Bertuch (Jun 03 2026 at 14:23):

Unfortunately, the homepage file is used "as is". There is no further templating implemented at this point. (CustomizationFileServlet or HomepageServlet).

view this post on Zulip Oliver Bertuch (Jun 03 2026 at 14:24):

You might be able to use some custom Javascript, using the session cookie to reach out to the API. Just a crazy idea, might be harder to do than I can foresee at this point. (Browser security and all)

view this post on Zulip Mahendra Paipuri (Jun 03 2026 at 14:57):

Cheers @Oliver Bertuch for the input. Looking at Harvard's custom home page and docs closely, I see that this custom home page is only overriding the body content of HTML. Folks at our instutite are using JS hack to replace the "entire" HTML page. Our home page is a small Vue app that has two pages as a SPA. Probably that is why they are replacing the entire home page. We will see if we can achieve the same without replacing header so that we can have user info in the nav bar!


Last updated: Aug 18 2026 at 08:27 UTC