CSRF for Rest API

Hello!

I am using in my project that is hosted on one domain such code example:

$app->post('/api/myEndPoint',function ($request, $response, $args) {
    //Do my Things Securely!
})->add('csrf');

it is okey

but how to get and send csrf from another domain to this endpoint ?
is there some examples or ides how to do this ?
or it is no need to do this for request from another domain ?

I am not understand you answer on my question in this topic

I think my answer was not precise enough to your question, so I deleted it. :sweat_smile:

How would the other domain get the csrf value? Would it make a request to get the csrf value and then make another request with the value? I can’t see the point in that?

okey, I see. csrf is not for Rest API

I apologize if my reply came across as rude. After re-reading it, it sounded like it to me.

May to help you this

CSRF (Cross-Site Request Forgery)

https://notes.enovision.net/slim/extras/csrf-cross-site-request-forgery