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

auth draft submitted #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Third party auth/com.cep.auth/.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<ExtensionList>
<Extension Id="com.cep.auth.panel">
<HostList>
<Host Name="PHXS" Port="8088" />
<Host Name="IDSN" Port="8087" />
<Host Name="AICY" Port="8086" />
<Host Name="ILST" Port="8085" />
<Host Name="PPRO" Port="8084" />
<Host Name="AEFT" Port="8083" />
<Host Name="PRLD" Port="8082" />
<Host Name="FLPR" Port="8081" />
<Host Name="DRWV" Port="8080" />
</HostList>
</Extension>
<Extension Id="com.cep.auth.localserver">
<HostList>
<Host Name="PHXS" Port="8188" />
<Host Name="IDSN" Port="8187" />
<Host Name="AICY" Port="8186" />
<Host Name="ILST" Port="8185" />
<Host Name="PPRO" Port="8184" />
<Host Name="AEFT" Port="8183" />
<Host Name="PRLD" Port="8182" />
<Host Name="FLPR" Port="8181" />
<Host Name="DRWV" Port="8180" />
</HostList>
</Extension>
</ExtensionList>
3 changes: 3 additions & 0 deletions Third party auth/com.cep.auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules
client/js/lib/CSInterface.js
78 changes: 78 additions & 0 deletions Third party auth/com.cep.auth/CSXS/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version='1.0' encoding='UTF-8'?>
<ExtensionManifest ExtensionBundleId="com.cep.auth" ExtensionBundleVersion="1.0.0" Version="7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionList>
<Extension Id="com.cep.auth.panel" Version="1.0.0" />
<Extension Id="com.cep.auth.localserver" Version="1.0.0" />
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<Host Name="PHXS" Version="16.0" />
<Host Name="ILST" Version="16.0" />
<Host Name="PHSP" Version="16.0" />
<Host Name="IDSN" Version="13.0" />
<Host Name="PPRO" Version="11.0" />
</HostList>
<LocaleList>
<Locale Code="All" />
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="7.0" />
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
<Extension Id="com.cep.auth.panel">
<DispatchInfo>
<Resources>
<MainPath>./client/index.html</MainPath>
<ScriptPath>./host/index.jsx</ScriptPath>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>Panel</Type>
<Menu>test-dropbox-example-app</Menu>
<Geometry>
<Size>
<Height>500</Height>
<Width>350</Width>
</Size>
<MinSize>
<Height>200</Height>
<Width>200</Width>
</MinSize>
<MaxSize>
<Height>600</Height>
<Width>400</Width>
</MaxSize>
</Geometry>
<Icons />
</UI>
</DispatchInfo>
</Extension>
<Extension Id="com.cep.auth.localserver">
<DispatchInfo>
<Resources>
<MainPath>./client/localServer.html</MainPath>
<CEFCommandLine>
<Parameter>--enable-nodejs</Parameter>
<Parameter>--mixed-context</Parameter>
</CEFCommandLine>
</Resources>
<Lifecycle>
<AutoVisible>false</AutoVisible>
</Lifecycle>
<UI>
<Type>Custom</Type>
<Geometry>
<Size>
<Height>500</Height>
<Width>350</Width>
</Size>
</Geometry>
<Icons />
</UI>
</DispatchInfo>
</Extension>
</DispatchInfoList>
</ExtensionManifest>
3 changes: 3 additions & 0 deletions Third party auth/com.cep.auth/client/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* {
font-family: sans-serif;
}
20 changes: 20 additions & 0 deletions Third party auth/com.cep.auth/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dropbox Example App</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h1>Dropbox Example App</h1>
<div id="button-group">
<button id="login-button">Log in with Dropbox</button>
<button id="user-button">Get user info</button>
</div>
<div id="canvas">
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/lib/CSInterface.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
12 changes: 12 additions & 0 deletions Third party auth/com.cep.auth/client/js/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const CLIENT_ID = "YOUR_DROPBOX_CLIENT_ID";
const CLIENT_SECRET = "YOUR_DROPBOX_SECRET";

try {
if (module) {
module.exports = {
CLIENT_ID: CLIENT_ID,
CLIENT_SECRET: CLIENT_SECRET
}
}
}
catch (err) {}
55 changes: 55 additions & 0 deletions Third party auth/com.cep.auth/client/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

/*
CSInterface
*/
var csInterface = new CSInterface();
/*
Linking Server
*/
csInterface.requestOpenExtension("com.cep.auth.localserver", "");

/*
UI Elements
*/
var loginButton = document.querySelector("#login-button");
var userButton = document.querySelector("#user-button");
var canvas = document.querySelector("#canvas");

/*
Event listeners
*/
loginButton.addEventListener("click", login);
userButton.addEventListener("click", getUserInfo);

/*
Helper methods
*/

function login() {
$.ajax({
type: "GET",
url: "http://localhost:3000/glogin",
success: response => {
window.location.href = response;
},
error: (jqXHR, textStatus, errorThrown) => {
console.log("error");
alert(JSON.parse(jqXHR.responseText).error);
}
})
}

function getUserInfo() {
$.ajax({
type: "GET",
url: "http://localhost:3000/user",
success: response => {
canvas.innerHTML = JSON.stringify(response.data);
},
error: (jqXHR, textStatus, errorThrown) => {
console.log("error");
alert(JSON.parse(jqXHR.responseText).error);
}
})

}
13 changes: 13 additions & 0 deletions Third party auth/com.cep.auth/client/localServer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
var localServer = cep_node.require(__dirname + '/server/main.js')();
</script>
<title>Dropbox Example App</title>
</head>
<body>

</body>
</html>
Empty file.
Loading