random authentication error

cancel
Showing results for 
Search instead for 
Did you mean: 
ipeinad2
Customer

random authentication error

Good morning,


I do the authentication qith my credentials and i obtain correctly the token, but after I
execute the next operation get with this token I receive response code 401 and 200 with the same request.
Why I receive sometimes error code 401?

 

Attach my postman with responses

Alfresco.pngRegards

1 Reply
abhinavmishra14
Advanced

Re: random authentication error

I am not sure what steps you exactly followed but the error you mentioned is something strange. 

These are two approaches to work with rest apis:

1- Get the basic auth base64 encoded string for the user credentials and use it for susequent requests by passing it as auth header. (not recommended)

2- Use the auth rest api to get the alf_ticket and use it for susequent request as auth header by converting to base64 encoded string. see the example here: 

https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#authenticating-to-get...

https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#using-the-ticket 

$ curl -X GET -H 'Accept: application/json' -H 'Authorization: Basic VElDS0VUXzA4ZWI3ZTJlMmMxNzk2NGNhNTFmMGYzMzE4NmNjMmZjOWQ1NmQ1OTM=' 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term=dog

Can you try the same request via curl and see what result you get? if you are using endpoint which is behind LB, then try hitting the nodes one by one and see what response you get. 

 

~Abhinav
(ACSCE, AWS SAA, GAIQ)