Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticated assets are not accessed using token authentication #331

Open
ashugthub opened this issue Jul 19, 2023 · 1 comment
Open

Authenticated assets are not accessed using token authentication #331

ashugthub opened this issue Jul 19, 2023 · 1 comment

Comments

@ashugthub
Copy link

ashugthub commented Jul 19, 2023

the following code is not working in cloudinary nuget package version -- 1.21.0. I am using .net core
AuthToken t = new AuthToken("MyKey").Expiration(1514764800);
string url = cloudinary.Api.Url
.AuthToken(t)
.Signed(true)
.Type("authenticated")
.BuildVideoTag("dog.mp4");

Type("authenticated") is not found in above code.

I am following https://cloudinary.com/documentation/control_access_to_media#delivering_token_based_authenticated_media_assets tutorial

Please also provide any sample for token based authentiv=cation .net core

@epasos573
Copy link
Contributor

Hi @ashugthub ,

The parameter for the authenticated is defined using the Action method of the Url class (see this reference). For example:

string KEY = "00112233FF99";
int DURATION = 300; //seconds
string ACL_ALL = "*";

var token = new AuthToken(KEY).Acl(ACL_ALL).Duration(DURATION);

string url = cloudinary.Api.Url
.AuthToken(token)
.Signed(true)
.Action("authenticated")
.BuildVideoTag("dog.mp4");

Console.WriteLine(url);

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants