Reputation: 5717
If I generate a Shared Access Signature for a specific blob or container, can you verify if that url/sas is still valid?
Let's assume I have my container called demo and I generate a SAS (4 days access using mycustompolicy) for it as bellow:
https://mystoragename.blob.core.windows.net/demo?sv=2012-02-12&sr=c&si=custompolicy&sig=hrcZKKPPcr4OyMR%2FoNJHGTF9l%2Fm8TQYoUg%2FU8bblOOk%3D
Is it possible to verify if this SAS is still valid or has expired?
I mean can you parse the url somehow and verify if the parameters are valid?
Upvotes: 0
Views: 537
Reputation: 136306
If the SAS expiry is defined in the access policy as you have done, you can't parse the SAS token to see if it's valid or not. One thing you could do is omit the SAS expiry date from access policy and define it only when creating SAS token. Then your SAS token will have a parameter called se
which will tell you exactly when SAS token would expire.
Upvotes: 2