How to authenticate jax-rs service to be access from liferay portlet only?

Jamie Sammons, modificat fa 4 anys. New Member Apunts: 2 Data d'incorporació: 07/10/21 Publicacions recents

I have build React js portlete that call jax-rs Rest service in the same Liferay server 

Now I don't know how call this jax-rs with the best authentication.

I try to use oAuth2 but it redirect user to login page but the user already loged in.

Also I have this idea to get authToken inside react js and used it to call the api but I don't know how how to impelemt this in api. 

Is there Any solution?