Hi,

A 401 response means that you have not successfully authenticated with that 
backend.  It's not possible to do any POST request without first 
authenticating (as all POSTs are access restricted).  See our documentation 
on how to authenticate via the REST 
API.  https://github.com/DSpace/RestContract/blob/main/authentication.md

The frontend always uses the authentication options described there.  In 
fact, you can compare your request to what the frontend does by just 
logging in via the frontend & watching the requests your browser sends to 
the backend.  We have a guide for that in our hints on "Finding which REST 
API Endpoint to use" 
here: 
https://wiki.lyrasis.org/display/DSDOC7x/REST+API#RESTAPI-FindingwhichRESTAPIEndpointtouse

Tim

On Tuesday, November 28, 2023 at 4:19:41 AM UTC-6 geethanj...@gmail.com 
wrote:

> Hello,
>
> I have created a drop-down field in the registration page which is fetched 
> the available community names.
>
> Now i want to create a resource policy for the register eperson to the 
> selected community id
>
> I'm facing 401 unauthorized error for POST 
> http://localhost:8080/server/api/authz/resourcepolicies?resource=93e64e4b-92f3-4da9-8db9-d3b2c74e99e2&eperson=63f4cca9-2adf-4471-a558-e17f7719273c
>  
>
> so i have tried to generate a constant jwt token to pass that in request 
> header to resolve the error but not working due to secret key generation 
> (tried through dspace frontend code).
>
> Is anyone know hoe to generate the secret key through frontend or is that 
> key has any formats, etc
>
> Or else how can i give permit all the functionalities for resource policy 
> creation for resolving unauthorized error.
> how to change the permission through code?
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/e9627f96-0955-491b-9cc6-0904cca5d944n%40googlegroups.com.

Reply via email to