0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

署名URLメモ

Posted at

概要

Cloudinaryに保存しているファイルをダウンロードするために、Laravelで署名URLを作成してダウンロードしたので対応メモ

署名の検証

Cloudinaryのサーバーでは、リクエストを受け取った後に次の手順で署名を検証します:

同じパラメータを使って署名を再生成

Cloudinary側は、リクエストから送られてきた public_id, timestamp, resource_type, format などのパラメータを使い、サーバー側に保存されている API Secret で署名を再生成します。

署名の比較

クライアント側から送られてきた signature と、Cloudinaryが生成した署名が一致するかを確認します。
署名が一致する場合

  • リクエストは正しいものと判断され、リソースが配信されます。

署名が一致しない場合

リクエストは改ざんされたとみなされ、エラーが返されます(例: 401 Unauthorized や 403 Forbidden)。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?