cancel
Showing results for 
Search instead for 
Did you mean: 

How to use nuxeo rest api without authenticate?

Mustafa_Mustafa
Champ in-the-making
Champ in-the-making

I use nuxeo rest api with basic authenticate. But I want to use it without authenticate? How can I solve it?

2 REPLIES 2

Rodri_
Star Contributor
Star Contributor

Hello,

I think you can use the Anonymous authentication: https://doc.nuxeo.com/nxdoc/using-anonymous-authentication/

However, you will need to contribute to "specificChain" extension point. For more info: https://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20Platform%20LTS%202019-10.10/viewContribut...

The contribution shouls be something like this:

<require>org.nuxeo.ecm.restapi.server.auth.config</require>

<extension target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService" point="specificChains">

	<specificAuthenticationChain name="RestAPI">
		<urlPatterns>
			<url>(.*)/api/v.*</url>
		</urlPatterns>
		<replacementChain>
			<plugin>ANONYMOUS_AUTH</plugin>
			<plugin>AUTOMATION_BASIC_AUTH</plugin>
			<plugin>TOKEN_AUTH</plugin>
			<plugin>OAUTH2_AUTH</plugin>
			<plugin>JWT_AUTH</plugin>
		</replacementChain>
	</specificAuthenticationChain>

</extension>

Regards.

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

Why are you avoiding authentication? This is a bad practice: allowing anonymous auth has a lot of side effects, specially on the UI part.

Regards