playstation-store-api icon indicating copy to clipboard operation
playstation-store-api copied to clipboard

This operation has been blocked as a potential Cross-Site Request Forgery (CSRF)

Open Prihod opened this issue 1 year ago • 4 comments

Hi, any request to the api returns an error This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either s (truncated...)

Prihod avatar Aug 08 '24 14:08 Prihod

Hi, @Prihod

Thanks for telling me about the problem

These headings helped me, I will try to release a new version with changes soon.

$client = new Client(
    RegionEnum::UNITED_STATES,
    new HTTPClient([
        'base_uri' => API_URL,
        'timeout' => 5,
        'headers' => [
            'content-type' => 'application/json',
            'origin' => 'https://store.playstation.com'
        ],
    ])
);

mrt1m avatar Aug 08 '24 17:08 mrt1m

@Prihod If you notice any other problems, please let me know. I will try to fix them as soon as possible.

mrt1m avatar Aug 08 '24 17:08 mrt1m

Hi, @Prihod

Thanks for telling me about the problem

These headings helped me, I will try to release a new version with changes soon.

$client = new Client(
    RegionEnum::UNITED_STATES,
    new HTTPClient([
        'base_uri' => API_URL,
        'timeout' => 5,
        'headers' => [
            'content-type' => 'application/json',
            'origin' => 'https://store.playstation.com'
        ],
    ])
);

Thank you, it's working

Prihod avatar Aug 08 '24 18:08 Prihod

New error

cURL error 35: error:0A000119:SSL routines::decryption failed or bad record mac (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://web.np.playstation.com/api/graphql/v1/op?operationName=metGetProductById

Prihod avatar Aug 08 '24 21:08 Prihod