{"id":931,"date":"2021-11-13T21:06:13","date_gmt":"2021-11-13T20:06:13","guid":{"rendered":"https:\/\/ondro.inginea.eu\/?p=931"},"modified":"2023-03-18T11:18:22","modified_gmt":"2023-03-18T10:18:22","slug":"get-user-info-in-jakarta-ee","status":"publish","type":"post","link":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/","title":{"rendered":"Get logged-in user info in Jakarta EE &#8211; the simplest way"},"content":{"rendered":"\n<p>The security before Java EE 8 \/ Jakarta  EE 8 used to be a bit complicated and confusing. Every specification provided its own way to retrieve information about the logged-in user. The situation greatly improved with the introduction of the <a href=\"https:\/\/jakarta.ee\/specifications\/security\/\">Security API<\/a> that provides a unified way to do that &#8211; simply inject the SecurityContext CDI bean. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>There&#8217;s still a small catch &#8211; this only works in the servlet context and EJB context. Or, in other words, when processing an HTTP request or inside any type of EJB. The good thing is that this covers most of the cases in which you&#8217;ll ever need to retrieve user information. In the other rare cases, you need to use one of the APIs which I also describe in this post.<\/p>\n\n\n\n<div class=\"wp-block-group omnifish-advert has-white-color has-text-color has-background\" style=\"background-color:#0b8f9b\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-color has-text-color\" style=\"grid-template-columns:auto 15%\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-medium-font-size\"><a rel=\"noreferrer noopener\" href=\"https:\/\/omnifish.ee\" data-type=\"URL\" data-id=\"https:\/\/omnifish.ee\" target=\"_blank\"><strong>Need help with GlassFish, Jakarta\u00a0EE, Java in the cloud?<\/strong><\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/omnifish.ee\" data-type=\"URL\" data-id=\"https:\/\/omnifish.ee\" target=\"_blank\">Follow me at <strong>OmniFish<\/strong>! <\/a><\/p>\n<\/div><figure class=\"wp-block-media-text__media\"><a href=\"https:\/\/omnifish.ee\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"178\" data-attachment-id=\"1034\" data-permalink=\"https:\/\/ondro.inginea.eu\/omnifish-logo-transparent-400px\/\" data-orig-file=\"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?fit=400%2C237&amp;ssl=1\" data-orig-size=\"400,237\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"omnifish-logo-transparent-400px\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?fit=300%2C178&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?fit=400%2C237&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?resize=300%2C178&#038;ssl=1\" alt=\"\" class=\"wp-image-1034 size-medium\" srcset=\"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2022\/07\/omnifish-logo-transparent-400px.png?w=400&amp;ssl=1 400w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/figure><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Unified access to user info using Security API<\/h2>\n\n\n\n<p>With the Security API, retrieving information about the current user is pretty easy straightforward:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Inject <a href=\"https:\/\/jakarta.ee\/specifications\/security\/2.0\/jakarta-security-spec-2.0.html#security-context\">SecurityContext<\/a><\/li>\n\n\n\n<li>Get the name of the user<ul><li>Call the method <code>getCallerPrincipal()<\/code><\/li><\/ul>\n<ul class=\"wp-block-list\">\n<li>If the result is <code>null<\/code>, no user is logged in<\/li>\n\n\n\n<li>Otherwise, call the method <code>getName()<\/code> to get the name of the logged-in user<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Verify that a user has a specific role (permission)\n<ul class=\"wp-block-list\">\n<li>Call the method <code>isCallerInRole(roleName)<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Full example of a servlet that prints user&#8217;s name and whether the user is in role &#8220;admin&#8221;:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Java\" data-shcb-language-slug=\"java\"><span><code class=\"hljs language-java shcb-code-table shcb-wrap-lines\"><span class='shcb-loc'><span><span class=\"hljs-meta\">@WebServlet<\/span>(urlPatterns = <span class=\"hljs-string\">\"\/servlet\"<\/span>)\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">UserInfoServlet<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">HttpServlet<\/span> <\/span>{\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><mark class='shcb-loc'><span>    <span class=\"hljs-meta\">@Inject<\/span>\n<\/span><\/mark><mark class='shcb-loc'><span>    SecurityContext userContext;\n<\/span><\/mark><span class='shcb-loc'><span>    \n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"hljs-meta\">@Override<\/span>\n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"hljs-function\"><span class=\"hljs-keyword\">protected<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">doGet<\/span><span class=\"hljs-params\">(HttpServletRequest req, HttpServletResponse resp)<\/span> <span class=\"hljs-keyword\">throws<\/span> ServletException, IOException <\/span>{\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><mark class='shcb-loc'><span>        <span class=\"hljs-comment\">\/\/ retrieve the principal and later check whether it's null or not<\/span>\n<\/span><\/mark><mark class='shcb-loc'><span>        Principal callerPrincipal = userContext.getCallerPrincipal();\n<\/span><\/mark><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span>        resp.getOutputStream().println(String.format(\n<\/span><\/span><span class='shcb-loc'><span>                <span class=\"hljs-string\">\"&lt;html&gt;&lt;body&gt;\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>                + <span class=\"hljs-string\">\"&lt;p&gt;User: %s&lt;\/p&gt;\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>                + <span class=\"hljs-string\">\"&lt;p&gt;Is admin: %s&lt;\/p&gt;\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>              + <span class=\"hljs-string\">\"&lt;\/body&gt;&lt;\/html&gt;\"<\/span>, \n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><mark class='shcb-loc'><span>        <span class=\"hljs-comment\">\/\/ print user's name only if the user is logger in and principal is not null<\/span>\n<\/span><\/mark><mark class='shcb-loc'><span>                callerPrincipal != <span class=\"hljs-keyword\">null<\/span> ? callerPrincipal.getName() : <span class=\"hljs-string\">\"not logged in\"<\/span>,\n<\/span><\/mark><mark class='shcb-loc'><span>        <span class=\"hljs-comment\">\/\/ true if user has admin role<\/span>\n<\/span><\/mark><mark class='shcb-loc'><span>                userContext.isCallerInRole(<span class=\"hljs-string\">\"admin\"<\/span>)));\n<\/span><\/mark><span class='shcb-loc'><span>    }\n<\/span><\/span><span class='shcb-loc'><span>    \n<\/span><\/span><span class='shcb-loc'><span>}\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Java<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">java<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Alternative ways to access user info<\/h2>\n\n\n\n<p>In case you can&#8217;t use the Security API, you can still use one of the other APIs that provide similar access to user information. A lot of other specification APIs provide similar methods to retrieve the name of the logged-in user and to check whether the user is in a specific role. Below is a summary of all possible ways:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"mtr-table mtr-tr-td\"><tbody><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">Specification API<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">Methods to call<\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">How to retrieve the user context<\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">Servlet<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name: <\/strong><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/servlet\/http\/HttpServletRequest.html#getUserPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/servlet\/http\/HttpServletRequest.html#getUserPrincipal--\" target=\"_blank\"><code>HttpServletRequest.getUserPrincipal<\/code>()<\/a><br><br>Returns <code>null<\/code> if not logged in.<br><br><strong>In role: <\/strong><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/servlet\/http\/HttpServletRequest.html#isUserInRole-java.lang.String-\" target=\"_blank\"><code>HttpServletRequest.isUserInRole<\/code>()<\/a><\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>@Inject<br>HttpServletRequest request;<\/code><br><br><code>HttpServletRequest<\/code> is also passed to servlet\u2019s methods<\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">EJB<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name: <\/strong><code><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ejb\/EJBContext.html#getCallerPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ejb\/EJBContext.html#getCallerPrincipal--\" target=\"_blank\">EJBContext.getCallerPrincipal()<\/a><\/code><br><br>If not logged in, returns a <code>Principal<\/code> with <code>getName() == \"ANONYMOUS\"<\/code> instead of <code>null<\/code><br><br><strong>In role: <\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ejb\/EJBContext.html#isCallerInRole-java.lang.String-\" target=\"_blank\">EJBContext.isCallerInRole()<\/a><\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>EJBContext<\/code> or any of its subinterfaces can be injected in an EJB or retrieved via JNDI:<br><br><code>@Resource<br>EJBContext ejbContext;<\/code><br><br><code>(EJBContext)new InitialContext()<\/code><br><code>.lookup(\"java:comp\/EJBContext\")<\/code><\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">REST<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name:<\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ws\/rs\/core\/SecurityContext.html#getUserPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ws\/rs\/core\/SecurityContext.html#getUserPrincipal--\" target=\"_blank\"><code>SecurityContext.getUserPrincipal()<\/code><\/a><br><br>Returns <code>null<\/code> if not logged in.<br><br><strong>In role:<\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/ws\/rs\/core\/SecurityContext.html#isUserInRole-java.lang.String-\" target=\"_blank\"><code>SecurityContext.isUserInRole()<\/code><\/a><\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>@Context<br>SecurityContext security;<\/code><\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">JSF<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name:<\/strong><br><code><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/faces\/context\/ExternalContext.html#getUserPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/faces\/context\/ExternalContext.html#getUserPrincipal--\" target=\"_blank\">ExternalContext.getUserPrincipal()<\/a><\/code><br><br>Returns <code>null<\/code> if not logged in.<br><br><strong>In role:<\/strong><br><code><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/faces\/context\/ExternalContext.html#isUserInRole-java.lang.String-\" target=\"_blank\">ExternalContext.isUserInRole()<\/a><\/code><\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>@Inject <br>ExternalContext externalContext;<\/code><br><br><code>FacesContext.getCurrentInstance()<\/code><br><code>.getExternalContext()<\/code><\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">CDI<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name:<\/strong><br><code><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/security\/Principal.html\" data-type=\"URL\" data-id=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/security\/Principal.html\" target=\"_blank\">@Inject Principal principal;<\/a><\/code><br><br>If not logged in, injects a <code>Principal<\/code> with <code>getName() == \"ANONYMOUS\"<\/code>, similar to EJB<br><br><strong>In role:<\/strong>  Not available<\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>@Inject Principal principal;<\/code><\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">WebSocket<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name:<\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/websocket\/Session.html#getUserPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/websocket\/Session.html#getUserPrincipal--\" target=\"_blank\"><code>Session.getUserPrincipal()<\/code><\/a><br><br>Returns <code>null<\/code> if not logged in.<br><br><strong>In role:<\/strong>  Not available<\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>Session<\/code> is passed as an argument to handlers of WebSocket events<\/div><\/td><\/tr><tr><td data-mtr-content=\"Specification API\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\">XML Web Services<\/div><\/td><td data-mtr-content=\"Methods to call\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><strong>User name:<\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/xml\/ws\/WebServiceContext.html#getUserPrincipal--\" data-type=\"URL\" data-id=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/xml\/ws\/WebServiceContext.html#getUserPrincipal--\" target=\"_blank\"><code>WebServiceContext.getUserPrincipal()<\/code><\/a><br><br>Returns <code>null<\/code> if not logged in.<br><br><strong>In role:<\/strong><br><a rel=\"noreferrer noopener\" href=\"https:\/\/jakarta.ee\/specifications\/platform\/9\/apidocs\/jakarta\/xml\/ws\/WebServiceContext.html#isUserInRole-java.lang.String-\" target=\"_blank\"><code>WebServiceContext.isUserInRole()<\/code><\/a><\/div><\/td><td data-mtr-content=\"How to retrieve the user context\" class=\"mtr-td-tag\"><div class=\"mtr-cell-content\"><code>WebServiceContext<\/code> can be injected in a WS endpoint:<br><br><code>@Resource<br>WebServiceContext wsContext;<\/code><\/div><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The Security specification also provides a summary of all the available methods to retrieve user&#8217;s name and role information in <a href=\"https:\/\/jakarta.ee\/specifications\/security\/2.0\/jakarta-security-spec-2.0.html#relationship-to-other-specifications-3\">4.5. Relationship to Other Specifications<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s the best way?<\/h2>\n\n\n\n<p>I&#8217;d certainly <strong>recommend using only the Security API&#8217;s <a href=\"https:\/\/jakarta.ee\/specifications\/security\/2.0\/jakarta-security-spec-2.0.html#security-context\">SecurityContext<\/a><\/strong> whenever possible, for the following reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It&#8217;s a unified API so you can learn and remember a single way to access user information<\/li>\n\n\n\n<li>It&#8217;s easy to use, just inject it as a CDI bean<\/li>\n\n\n\n<li>It provides all the information provided by any of the other APIs<\/li>\n\n\n\n<li>It&#8217;s cleaner in case the user isn&#8217;t logged &#8211; returns <code>null<\/code> Principal instead of a Principal with a default name<\/li>\n<\/ul>\n\n\n\n<p>The only drawback is that currently it only works in Servlet and EJB contexts. Even though these 2 contexts are the most widely used, it&#8217;s still possible that in some rare cases the Security API can&#8217;t be used. Hopefully, the future versions of the Security specification will also cover other contexts. And even if not, the contexts where it wouldn&#8217;t work are related to some legacy and old Jakarta APIs and are nowadays very rarely used. In fact so rarely that you will probably not use any of them ever.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. Every specification provided its own way to retrieve information about the logged-in user. The situation greatly improved with the introduction of the Security API that provides a unified way to do that &#8211; simply inject the SecurityContext [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":940,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"My new blog post: How to get logged-in user in Jakarta EE - the Security API to the rescue! ","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[194],"tags":[15,83,171],"series":[],"class_list":["post-931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ee-security","tag-java","tag-javaee-en","tag-security"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding<\/title>\n<meta name=\"description\" content=\"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding\" \/>\n<meta property=\"og:description\" content=\"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\" \/>\n<meta property=\"og:site_name\" content=\".Lost in Coding\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ondrej.mihalyi\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ondrej.mihalyi\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-13T20:06:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-18T10:18:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ondro.inginea.eu\/wp-content\/uploads\/2021\/11\/600px-User-info.svg_-e1636833902117.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"113\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ondro Mih\u00e1lyi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/OndroMih\" \/>\n<meta name=\"twitter:site\" content=\"@OndroMih\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ondro Mih\u00e1lyi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\"},\"author\":{\"name\":\"Ondro Mih\u00e1lyi\",\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616\"},\"headline\":\"Get logged-in user info in Jakarta EE &#8211; the simplest way\",\"datePublished\":\"2021-11-13T20:06:13+00:00\",\"dateModified\":\"2023-03-18T10:18:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\"},\"wordCount\":628,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616\"},\"keywords\":[\"Java\",\"javaee\",\"security\"],\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\",\"url\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\",\"name\":\"Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding\",\"isPartOf\":{\"@id\":\"https:\/\/ondro.inginea.eu\/#website\"},\"datePublished\":\"2021-11-13T20:06:13+00:00\",\"dateModified\":\"2023-03-18T10:18:22+00:00\",\"description\":\"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.\",\"breadcrumb\":{\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ondro.inginea.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get logged-in user info in Jakarta EE &#8211; the simplest way\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ondro.inginea.eu\/#website\",\"url\":\"https:\/\/ondro.inginea.eu\/\",\"name\":\".Lost in Coding\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ondro.inginea.eu\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616\",\"name\":\"Ondro Mih\u00e1lyi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i2.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2017\/08\/fotoOMsquare3x300.jpg?fit=300%2C300&ssl=1\",\"contentUrl\":\"https:\/\/i2.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2017\/08\/fotoOMsquare3x300.jpg?fit=300%2C300&ssl=1\",\"width\":300,\"height\":300,\"caption\":\"Ondro Mih\u00e1lyi\"},\"logo\":{\"@id\":\"https:\/\/ondro.inginea.eu\/#\/schema\/person\/image\/\"},\"description\":\"Ondro is a software developer and consultant specializing in combining standard and proven tools to solve new and challenging problems. He's been developing in Java for over 10 years. He\u2019s worked for clients like Payara, LottoLand, Uniqa and others. He has co-founded OmniFish, where he works as a director and Jakarta EE expert. He\u2019s passionate about helping his clients and the wider Java community with their projects based on Jakarta EE and similar technologies. As an experienced Java developer and instructor, he's helped companies build and educate their development teams and improve their development processes. He's a core member of several opensource projects and Jakarta EE specification projects. He\u2019s a frequent conference speaker, leader of the Czech JUG and a Java Champion. Ondro is a regular conference speaker at international conferences. Since 2016, he's presented at the following conferences: \u2022 FOSDEM, Brussels, Belgium 2023) \u2022 JChampionsConf, Online (year 2023) \u2022 EclipseCon, Germany (year 2022) \u2022 GeeCon, Prague, Czechia (years 2016, 2019, 2022) \u2022 JavaLand, Bruehl, Germany (years 2018, 2021) \u2022 JFokus, Stockholm, Sweden (year 2019) \u2022 Devops Con, Munich, Germany (year 2019) \u2022 Oracle CodeOne, San Francisco, USA (years 2018, 2019) \u2022 Devoxx, Antwerp, Belgium (year 2018) \u2022 JPrime, Sofia, Bulgaria (years 2017, 2018) \u2022 Java2Days, Sofia, Bulgaria (years 2016, 2018) \u2022 EclipseCon, France (year 2018) \u2022 JavaOne, San Francisco, USA (years 2016, 2017) \u2022 Oracle Code, Prague, Czechia (year 2017) \u2022 Devoxx, London, UK (year 2017) \u2022 GeeCon, Krakow, Poland (year 2017) \u2022 W-JAX, Munich, Germany (years 2016, 2017) \u2022 Bed-Con, Berlin, Germany (year 2017) \u2022 Oredev, Malmo, Sweden (year 2017) \u2022 Devoxx, Casablanca, Morocco (year 2017) \u2022 Java Developer Days, Krakow, Poland (year 2016)\",\"sameAs\":[\"https:\/\/www.facebook.com\/ondrej.mihalyi\",\"https:\/\/cz.linkedin.com\/in\/mihalyiondrej\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/OndroMih\"],\"url\":\"https:\/\/ondro.inginea.eu\/index.php\/author\/ondrejm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding","description":"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/","og_locale":"en_US","og_type":"article","og_title":"Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding","og_description":"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.","og_url":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/","og_site_name":".Lost in Coding","article_publisher":"https:\/\/www.facebook.com\/ondrej.mihalyi","article_author":"https:\/\/www.facebook.com\/ondrej.mihalyi","article_published_time":"2021-11-13T20:06:13+00:00","article_modified_time":"2023-03-18T10:18:22+00:00","og_image":[{"width":300,"height":113,"url":"https:\/\/ondro.inginea.eu\/wp-content\/uploads\/2021\/11\/600px-User-info.svg_-e1636833902117.png","type":"image\/png"}],"author":"Ondro Mih\u00e1lyi","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/OndroMih","twitter_site":"@OndroMih","twitter_misc":{"Written by":"Ondro Mih\u00e1lyi","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#article","isPartOf":{"@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/"},"author":{"name":"Ondro Mih\u00e1lyi","@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616"},"headline":"Get logged-in user info in Jakarta EE &#8211; the simplest way","datePublished":"2021-11-13T20:06:13+00:00","dateModified":"2023-03-18T10:18:22+00:00","mainEntityOfPage":{"@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/"},"wordCount":628,"commentCount":0,"publisher":{"@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616"},"keywords":["Java","javaee","security"],"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/","url":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/","name":"Get logged-in user info in Jakarta EE - the simplest way - .Lost in Coding","isPartOf":{"@id":"https:\/\/ondro.inginea.eu\/#website"},"datePublished":"2021-11-13T20:06:13+00:00","dateModified":"2023-03-18T10:18:22+00:00","description":"The security before Java EE 8 \/ Jakarta EE 8 used to be a bit complicated and confusing. The situation greatly improved with the introduction of the Security API that provides a unified way to do that - simply inject the SecurityContext CDI bean.","breadcrumb":{"@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ondro.inginea.eu\/index.php\/get-user-info-in-jakarta-ee\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ondro.inginea.eu\/"},{"@type":"ListItem","position":2,"name":"Get logged-in user info in Jakarta EE &#8211; the simplest way"}]},{"@type":"WebSite","@id":"https:\/\/ondro.inginea.eu\/#website","url":"https:\/\/ondro.inginea.eu\/","name":".Lost in Coding","description":"","publisher":{"@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ondro.inginea.eu\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/07ac1158ec74720744f7146572215616","name":"Ondro Mih\u00e1lyi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/image\/","url":"https:\/\/i2.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2017\/08\/fotoOMsquare3x300.jpg?fit=300%2C300&ssl=1","contentUrl":"https:\/\/i2.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2017\/08\/fotoOMsquare3x300.jpg?fit=300%2C300&ssl=1","width":300,"height":300,"caption":"Ondro Mih\u00e1lyi"},"logo":{"@id":"https:\/\/ondro.inginea.eu\/#\/schema\/person\/image\/"},"description":"Ondro is a software developer and consultant specializing in combining standard and proven tools to solve new and challenging problems. He's been developing in Java for over 10 years. He\u2019s worked for clients like Payara, LottoLand, Uniqa and others. He has co-founded OmniFish, where he works as a director and Jakarta EE expert. He\u2019s passionate about helping his clients and the wider Java community with their projects based on Jakarta EE and similar technologies. As an experienced Java developer and instructor, he's helped companies build and educate their development teams and improve their development processes. He's a core member of several opensource projects and Jakarta EE specification projects. He\u2019s a frequent conference speaker, leader of the Czech JUG and a Java Champion. Ondro is a regular conference speaker at international conferences. Since 2016, he's presented at the following conferences: \u2022 FOSDEM, Brussels, Belgium 2023) \u2022 JChampionsConf, Online (year 2023) \u2022 EclipseCon, Germany (year 2022) \u2022 GeeCon, Prague, Czechia (years 2016, 2019, 2022) \u2022 JavaLand, Bruehl, Germany (years 2018, 2021) \u2022 JFokus, Stockholm, Sweden (year 2019) \u2022 Devops Con, Munich, Germany (year 2019) \u2022 Oracle CodeOne, San Francisco, USA (years 2018, 2019) \u2022 Devoxx, Antwerp, Belgium (year 2018) \u2022 JPrime, Sofia, Bulgaria (years 2017, 2018) \u2022 Java2Days, Sofia, Bulgaria (years 2016, 2018) \u2022 EclipseCon, France (year 2018) \u2022 JavaOne, San Francisco, USA (years 2016, 2017) \u2022 Oracle Code, Prague, Czechia (year 2017) \u2022 Devoxx, London, UK (year 2017) \u2022 GeeCon, Krakow, Poland (year 2017) \u2022 W-JAX, Munich, Germany (years 2016, 2017) \u2022 Bed-Con, Berlin, Germany (year 2017) \u2022 Oredev, Malmo, Sweden (year 2017) \u2022 Devoxx, Casablanca, Morocco (year 2017) \u2022 Java Developer Days, Krakow, Poland (year 2016)","sameAs":["https:\/\/www.facebook.com\/ondrej.mihalyi","https:\/\/cz.linkedin.com\/in\/mihalyiondrej","https:\/\/twitter.com\/https:\/\/twitter.com\/OndroMih"],"url":"https:\/\/ondro.inginea.eu\/index.php\/author\/ondrejm\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2021\/11\/600px-User-info.svg_-e1636833902117.png?fit=300%2C113&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6wlb6-f1","jetpack-related-posts":[{"id":769,"url":"https:\/\/ondro.inginea.eu\/index.php\/new-features-in-java-versions-since-java-8\/","url_meta":{"origin":931,"position":0},"title":"New features between Java 8 and Java 19","author":"Ondro Mih\u00e1lyi","date":"8 October, 2022","format":false,"excerpt":"Since version 9, Java has new features every 6 months and it's very hard to keep track of these new changes. Most of the information on the internet describes changes between the last 2 Java versions. However, if you're in a similar situation as me, you're not using one of\u2026","rel":"","context":"In &quot;Java&quot;","block_context":{"text":"Java","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/java\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ondro.inginea.eu\/wp-content\/uploads\/2021\/09\/duke-CloudSurf-small-e1637277171314.png?fit=300%2C202&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":998,"url":"https:\/\/ondro.inginea.eu\/index.php\/introduction-to-concurrency-and-threads-in-java-web-apps\/","url_meta":{"origin":931,"position":1},"title":"Introduction to concurrency and threads in Java web apps","author":"Ondro Mih\u00e1lyi","date":"3 July, 2022","format":false,"excerpt":"Threads, concurrency, or synchronization are not very easy to understand concepts. Jakarta EE builds on standard Java features and makes them easier to understand and use, using the thread pool concept and the Jakarta Concurrency API.","rel":"","context":"In &quot;Jakarta EE&quot;","block_context":{"text":"Jakarta EE","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/java\/jakarta-ee\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":877,"url":"https:\/\/ondro.inginea.eu\/index.php\/jakarta-ee-experts-at-eclipsecon-2021\/","url_meta":{"origin":931,"position":2},"title":"Jakarta EE experts at EclipseCon 2021","author":"Ondro Mih\u00e1lyi","date":"23 August, 2021","format":false,"excerpt":"EclipseCon conference is a great event for all Java developers, especially those who are passionate about and believe in opensource. The conference is scheduled for 26-28 October 2021. I wholeheartedly recommend to attend it. It's a free online event, you just need to register to attend: https:\/\/www.eclipsecon.org\/2021 Specifically for users\u2026","rel":"","context":"In &quot;Events &amp; Conferences&quot;","block_context":{"text":"Events &amp; Conferences","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/events-conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":209,"url":"https:\/\/ondro.inginea.eu\/index.php\/mvc-1-0-in-java-ee-8-getting-started-using-facelets\/","url_meta":{"origin":931,"position":3},"title":"MVC 1.0 in Java EE 8: Getting started using facelets","author":"Ondro Mih\u00e1lyi","date":"19 January, 2016","format":false,"excerpt":"MVC 1.0 is an action-based Model-View-Controller web framework, which will be a part of future Java EE 8. It will live side by side with component-based JSF framework and will provide an alternative for building HTML+javascript oriented applications with full control over URLs. This post summarizes what needs to be\u2026","rel":"","context":"In &quot;Jakarta EE&quot;","block_context":{"text":"Jakarta EE","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/java\/jakarta-ee\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":513,"url":"https:\/\/ondro.inginea.eu\/index.php\/oracle-to-open-javaee-what-to-expect\/","url_meta":{"origin":931,"position":4},"title":"Oracle announced to open JavaEE &#8211; what to expect in the future?","author":"Ondro Mih\u00e1lyi","date":"26 August, 2017","format":false,"excerpt":"Last week, Oracle announced their intentions to open Java EE and transfer it to an open source foundation to continue its development in a more open way. I've been involved in some email discussions (here and here) and in a conference call organized by Oracle and\u00a0I want to summarize what\u2026","rel":"","context":"In &quot;Opinions&quot;","block_context":{"text":"Opinions","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":678,"url":"https:\/\/ondro.inginea.eu\/index.php\/speed-up-services-with-reactive-api-in-java-ee-8\/","url_meta":{"origin":931,"position":5},"title":"Speed Up Services With Reactive API in Java EE 8","author":"Ondro Mih\u00e1lyi","date":"27 June, 2018","format":false,"excerpt":"Services can often be optimized with asynchronous processing even without changing their behavior towards the outside world. The reason why some services aren't efficient is that they need to wait for other services to provide a result to continue further. Let's look how to call external REST services without waiting\u2026","rel":"","context":"In &quot;REST&quot;","block_context":{"text":"REST","link":"https:\/\/ondro.inginea.eu\/index.php\/category\/java\/jakarta-ee\/ee-rest\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/posts\/931"}],"collection":[{"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":12,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":1115,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/posts\/931\/revisions\/1115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/media\/940"}],"wp:attachment":[{"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/tags?post=931"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ondro.inginea.eu\/index.php\/wp-json\/wp\/v2\/series?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}