---
title: "Comment by Nicolas Pilot on \"CKEditor5 Image Upload\" | Hashnode"
description: "Hi Louis, Thank you for this amazing blog. It is very helpful. ORDS Security Concerning the ORDS First Party Authentication ( Apex-Session ), do we need to setu"
url: "https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58/comment/62ecb0cacbce7c268014f9e0"
---

[Discussion](https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58)

Comment [CKEditor5 Image Upload](https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58)

[Nicolas Pilot](https://hashnode.com/@NPilot)

[Aug 5, 2022](https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58/comment/62ecb0cacbce7c268014f9e0)

Hi Louis, Thank you for this amazing blog. It is very helpful.

### ORDS Security

Concerning the ORDS First Party Authentication (**Apex-Session**), do we need to setup something on ORDS for that to work ?

I've spent a lot of time trying to make it working but for some reason ORDS always return **401 Unauthorized** error. (I can see in the POST request of my browser the http header "apex-session" with the correct value but ORDS reject the request ).

I've tried using a ORDS OAUTH2 Token and it works properly.

### Image Store

Concerning the image storage, I'm not a big fan of storing blob inside the database.

And I also think that there is a better approach to send the images to the storage location without using ORDS and overloading the database with blob handling.

The idea is to send the image directly from the client browser to Google Cloud Storage (or another cloud storage).

GCS provide JSON API to "Initiate a resumable upload session" which return a secure upload URL. We only need to define a PL/SQL Function to initiate an upload session on GCS using OAUTH2 to return an "upload url" to the client. That way, the GCS oauth token is not visible by the client, which is something we want to avoid to secure the bucket content.

The challenge here is to be able to dynamically set the upload url of the "CKEditor Simple upload adaptor" by executing an AJAX Call to execute that PL/SQL function when the user pick an image... + Another challenge is the successful response that the "CKEditor Simple upload adapter" is waiting for : { "url":"....." } Maybe we would have to define a "Custom upload adapter"

Best Regards

-   Nicolas

[Louis Moreaux](https://hashnode.com/@lmoreaux)

[Aug 9, 2022](https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58/comment/62ecb0cacbce7c268014f9e0#reply-62f20f28408d676b1b589150)

Hi Nicolas, Thank you for your comment, it means a lot.

To protect ORDS endpoint, you have to define a privilege and protect your module with this privilege. Have you follow this step? OAuth2 is also a valid approach.

I am also not a big fan of blob storage but it's really easy to make it working quickly. I am working on another post with images stored in an OCI bucket. Stay tuned :-)

[Nicolas Pilot](https://hashnode.com/@NPilot)

[Aug 9, 2022](https://hashnode.com/posts/ckeditor5-image-upload/62d7d721ca829b4aca565e58/comment/62ecb0cacbce7c268014f9e0#reply-62f216b3408d676b1b5892ff)

[Louis Moreaux](https://hashnode.com/@lmoreaux) Thank you Louis, Yes, I've followed all the steps, and it is working fine for OAuth2, but for some reasons, the ORDS does not authorize my requests with the "Apex-Session" header. Maybe a cookie issue...

[oracle.com/application-development/technologies/r…](https://www.oracle.com/application-development/technologies/rest-data-services/listener-dev-guide.html)

Good news for your next post. Would be nice if the images could be sent directly from the client to OCI bucket without going through the database... this would save CPU & Bandwidth...

Another challenge is to be able to automatically compress and resize the images on the client side before uploading to OCI... ;-)
