Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

License validation with UXP/Extension/Script?

Explorer ,
Dec 14, 2021 Dec 14, 2021

I'd like to be able to recall to a webpage of my development to verify a purchase that would've been made on my site. 

 

E.g. 

Purchase on website > install plugin/extension/script > met with dialog for license validation > input license validation > give access to plugin/extension/script

 

Otherwise have the plugin code inaccessible or just have the code locked or uninstalled or something of the like. While developing, I would like to be able to minimize/eliminate the "copy to a friend" scenario. 

 

Thank you in advance. 

TOPICS
Actions and scripting , macOS
827
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Dec 15, 2021 Dec 15, 2021

I ended up successfully piecing together scattered documentation for what I was looking to do regarding this topic. Anybody else wanting this can use what I've brought together. This is intended be used in photoshop .js (javascript) standalone scripts. File > Scripts > Browse...

While developing a script, I would variable hash and compound the script itself so it is less likely to be tampered with. 

 

// START WEB GET CALL

reply = "";
conn = new Socket();    

var hosturl = "www.yourdomain.com",
 
...
Translate
Adobe
LEGEND ,
Dec 15, 2021 Dec 15, 2021
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 15, 2021 Dec 15, 2021
LATEST

I ended up successfully piecing together scattered documentation for what I was looking to do regarding this topic. Anybody else wanting this can use what I've brought together. This is intended be used in photoshop .js (javascript) standalone scripts. File > Scripts > Browse...

While developing a script, I would variable hash and compound the script itself so it is less likely to be tampered with. 

 

// START WEB GET CALL

reply = "";
conn = new Socket();    

var hosturl = "www.yourdomain.com",
    fullCallUrl = "http://www.yourdomain.com/api/index.php?var=value"
    
if (conn.open (hosturl + ":80", "binary")) { 
    $.writeln("Connected!");
    conn.write ("GET " + fullCallUrl + " HTTP/1.0\r\nHost:" + hosturl + "\r\nConnection: close\r\n\r\n");
    reply = conn.read(999999);
    $.writeln(reply); // FULL REPLY
    conn.close();    
}

reply = reply.toString().match(/\{.+\}/g);
reply = eval("[" + reply + "]");

    alert(reply[0].info); // alert out the json object associated with a message

// END WEB GET CALL

// ------------------------------------------------------------------------------------

// START ADDING "COOKIE"/SETTING *AFTER SUCCESSFULL VERIFICATION

var settingPref = true; // master variable for boolean setting

var desc = new ActionDescriptor();// create a descriptor to hold value
desc.putBoolean ( 0 , settingPref );// store the data by type
app.putCustomOptions( 'customVariableName', desc, true );// store the descritor by unique name

var desc = app.getCustomOptions ( 'customVariableName' );// retrive by name
var settingPref = desc.getBoolean(0);// retrive the data by type

// app.eraseCustomOptions( 'testingScript' ); // delete when no longer needed, may not be needed

// END ADDING "COOKIE"/SETTING 
       

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines