I tried using emailjs browserbox to connect to an imap server but the sample script with the correct port and host and username and password just throws out errors and doesn't work in a client-side html file?
https://github.com/whiteout-io/browserbox is a link to the api. What's wrong with how I wrote the code?
<html>
<head>
<title>Test</title>
<!-- Required for non-Unicode encodings -->
<script src="encoding-indexes.js"></script>
<script src="encoding.js"></script>
<script src="stringencoding.min.js"></script>
<script src="browserbox.js"></script>
<script src="browserbox-imap.js"></script>
<script> var client = new BrowserBox('host', port, {
auth: {
user: 'testuser',
pass: 'testpass'
},
id: {
name: 'My Client',
version: '0.1'
} });
</script>
</head>
<body>
</body>
</html>
Related
I’m using Academy LMS script with Academy LMS Live Class (zoom) Addon.
This addon asked me to enter api key and security key, I did.
Then I start a meeting via the zoom app and save the id and password to the system as a teacher.
When i try to connect a meeting as a student i get this error: “Joining meeting timeout. Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.”
Please help me on this issue, thanks.
Thats my code:
<!DOCTYPE html>
<head>
<title>Zoom</title>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.7/css/bootstrap.css"/>
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.7/css/react-select.css"/>
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<script src="https://source.zoom.us/1.7.7/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/1.7.7/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/1.7.7/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/1.7.7/lib/vendor/redux-thunk.min.js"></script>
<script src="https://source.zoom.us/1.7.7/lib/vendor/jquery.min.js"></script>
<script src="https://source.zoom.us/1.7.7/lib/vendor/lodash.min.js"></script>
<script src="https://source.zoom.us/zoom-meeting-1.7.7.min.js"></script>
<script>
$( document ).ready(function() {
start_zoom();
});
function start_zoom() {
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
testTool = window.testTool;
var meetConfig = {
apiKey: 'Existing Values',
apiSecret: 'Existing Values',
meetingNumber: 'Existing Values',
userName: 'Existing Values',
passWord: 'Existing Values',
};
var signature = ZoomMtg.generateSignature({
meetingNumber: meetConfig.meetingNumber,
apiKey: meetConfig.apiKey,
apiSecret: meetConfig.apiSecret,
role: 0,
success: function(res){
console.log(res.result);
}
});
ZoomMtg.init({
leaveUrl: "file:///C:/Users/User/Desktop/zoom.html",
isSupportAV: true,
success: function () {
ZoomMtg.join(
{
meetingNumber: meetConfig.meetingNumber,
userName: meetConfig.userName,
signature: signature,
apiKey: meetConfig.apiKey,
passWord: meetConfig.passWord,
success: function(res){
console.log('join meeting success');
},
error: function(res) {
console.log(res);
}
}
);
},
error: function(res) {
console.log(res);
}
});
}
</script>
</body>
</html>
My Error : “Joining meeting timeout. Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again”
Error Image:
enter image description here
I am trying to make a chatbot from Cognigy.ai. I made a small bot but I am not able to customize it's webchat interface from the Github repo, but I am not able to figure out how to do it?
This is the endpoint of my chatbot:
<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
<style>
html {
background-color: #eee;
}
</style>
</head>
<body>
<!-- 1. Load the webchat.js bundle via a script tag -->
<script src="https://github.com/Cognigy/WebchatWidget/releases/download/v2.20.0/webchat.js"></script>
<!-- Initialize the Webchat towards a Cogngiy Endpoint via initWebchat() -->
<script>
initWebchat(
"https://endpoint-trial.cognigy.ai/8a8b023c1da283e1c9191c471aaef8dc5090ccc8f33d6a39b00a80276754309e",
{
userId: "documentation-reader",
forceWebsockets: true
}
);
</script>
</body>
</html>
I am trying to remove the 'Powered by Cognigy AI' line from the webchat interface. In the Github repo they mentioned that I need to disableBranding = True. But where should I write it?
The Github repo for customization is:
https://github.com/Cognigy/WebchatWidget/blob/master/docs/embedding.md
Like this,
<script>
initWebchat(
"https://endpoint-trial.cognigy.ai/8a8b023c1da283e1c9191c471aaef8dc5090ccc8f33d6a39b00a80276754309e",
{
settings: {
colorScheme: "#fab",
disableBranding: true
}
}
);
</script>
You need to add
settings: {
disableBranding: true
}
after the line:
forceWebsockets: true,
make sure you add a comma after forceWebsockets: true = forceWebsockets: true,
As it is mentioned in their documentation:
Name: Settings | Type: Endpoint Settings
I am trying to implement login with linked in my web app. Here is my code..
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 'key here'
</script>
</head>
<body>
<script>
IN.User.authorize(function (e) {
console.log(e);
}, function (e) {
console.log(e);
});
</script>
</body>
But its giving me error 'Cannot read property 'then' of undefined at Object.authorize (in.js:18)'
i have also tried this way..
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 'key here'
onLoad: 'onLinkedInLoad'
authorize: true
</script>
</head>
<body>
<!-- LinkedIn signin button -->
<script type="in/Login"></script>
<script type="text/javascript">
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
IN.Event.on(IN, "auth", getProfileData);
}
</script>
</body>
but its giving me errror
'in.js:7 Uncaught (in promise) TypeError: Could not instantiate tag for 'login': Cannot read property 'on' of null
at new (Login.js?version=0.1.149:7)
at in.js:18'
The documentation and examples for linkedIn show api_key and onLoad function not being set as a string delimeter.
api_key: 0192afsdj10
onLoad: onLinkedInLoad
Secondly, you have not added in a function for the getProfileData function.
Here is an example of the should look like.
function getProfileData() {
IN.API.Profile("me").fields("id", "first-name", "last-name", "headline", "location", "picture-url", "public-profile-url", "email-address").result(displayProfileData);
}
function displayProfileData(profiles){
var member = profiles.values[0];
console.log(member);
}
See code referenced here
So I'm using the Okta Sign-In Widget to authenticated users for my internal WebApp.
However, I'm struggling how I get the sessionID from the created session stored in a cookie from my domain or posted back in a response to then be saved, so it can be then used later to carry out actions on that users session (for instance logout). My JavaScript ability is terrible but I'm trying to learn here. Please see below my code for the login page. If someone could help me how I can as a response from the login get the sessionID to then be used, it would be greatly appreciated.
<!DOCTYPE html>
<html>
<head>
<?php echo $MetaData['charset']."\n";?>
<?php echo $MetaData['viewport']."\n";?>
<?php echo $MetaData['description']."\n";?>
<?php echo $MetaData['author']."\n";?>
<?php echo $MetaData['title']."\n";?>
<link rel="shortcut icon" href="">
<script src="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.7.0/js/okta-sign-in.min.js" type="text/javascript"></script>
<link href="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.7.0/css/okta-sign-in.min.css" type="text/css" rel="stylesheet">
<link href="https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/1.7.0/css/okta-theme.css" type="text/css" rel="stylesheet">
<link href="<?php echo base_url().'assets/css/custom.css' ?>"type="text/css" rel="stylesheet">
</head>
<body style="background-color:#f5f5f5;">
<div id="okta-login-container"></div>
<script type="text/javascript">
var orgUrl = '<?php echo $OktaInstanceConfig['OktaInstanceURL'];?>';
var redirectUrl = '<?php echo base_url().'index.php/Dashboard' ?>';
var oktaSignIn = new OktaSignIn({
baseUrl: orgUrl,
logo: '<?php echo base_url()."assets/images/".$CompanyConfig["CompanyName"]."/logo.svg"?>',
authParams: {
responseType: 'id_token',
responseMode: 'okta_post_message',
scope: [
'openid',
'email',
'profile',
'address',
'phone',
'groups'
]
}
});
oktaSignIn.renderEl(
{ el: '#okta-login-container' },
function (res) {
if (res.status === 'SUCCESS')
{
console.log('User %s successfully authenticated %o', res.user.profile.login, res.user);
res.session.setCookieAndRedirect(redirectUrl);
}
}
);
</script>
</body>
</html>
Okta sets the user session after the method setCookieAndRedirect(redirectUrl) is called.
The logic inside of your redirectUrl (index.php) can get the sessionId by retrieving the current session using the Sign-In Widget:
<!-- index.php -->
<!DOCTYPE html>
<html>
<head> <!-- scripts and stylesheets --> </head>
<body>
<script type="text/javascript">
var oktaSignIn = new OktaSignIn({ /* config */});
oktaSignIn.session.exists(function (exists) {
if (exists) {
// Session exists
oktaSignIn.session.get(function (sessionInfo) {
// sessionInfo.id
}, function(err) { // error retrieving session })
return;
} else { console.log("No session");
}
});
</script>
</body>
</html>
I am very new to AngularJS, and I am trying to get some items in JSON from a webservice I quickly made using ServiceStack. When I try the URL in the browser I can see the JSON object, but for some reason AngularJS fails to successfully get the data. Here's my implementation:
angular.module('SomeApp', []).controller('ItemsFetcher', [ '$http', function($http){
var x = this;
x.products= [
{
Name: 'Missing items',
Description: 'Could not access server'
}];
$http.get('http://localhost:29029/json/reply/GetAllItemsRequest')
.then(function(data){
x.products = [
{
Name: 'Success',
Description: 'Great stuff!'
}];
});
}]);
Here's the view:
<html ng-app="SomeApp">
<head>
<title>My First App</title>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-controller="ItemsFetcher as fetcher">
<h3>PRODUCTS</h3>
<div ng-repeat="item in fetcher.products">
<div>{{item.Name}} - {{item.Description}}</div>
</div>
</body>
As I said, if I call http://localhost:29029/json/reply/GetAllItemsRequest in a browser, I can the JSON object.
Am I missing something ? Any ideas why this does not work ?
In case anyone could benefit from this, I had to either enable CORS (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) or to host both the webservice and website in the same place.